Disclaimer : this answer isn't backed by any source, aside from personal experience.
Edit : found a source https://health-clevelandclinic-org.cdn.ampproject.org/v/s/health.clevelandclinic.org/what-happens-to-your-body-during-the-fight-or-flight-response/amp/?amp_js_v=a6&_gsa=1&usqp=mq331AQHKAFQArABIA%3D%3D#aoh=16167791861704&referrer=https%3A%2F%2Fwww.google.com&_tf=Source%C2%A0%3A%20%251%24s&share=https%3A%2F%2Fhealth.clevelandclinic.org%2Fwhat-happens-to-your-body-during-the-fight-or-flight-response%2F
My psychiatrist explained to me that people with anxiety are often in "survival mode". Not only when they are having a panick attack, but most of the time, because of the high stress levels. Imagine being constantly in danger. Thats' how we feel.
When in danger, our bodies prioritize all other important organs (heart, lungs...), and our cognitive capacities become impaired. When in danger, the last thing our body wants to do is to remember what's happening. All it wants to do is to flee that situation, or to fight the danger.
In addition, anxiety leads to exhaustion, which also impairs our cognitive capacities.
Again, I don't know if my psychiatrist made this up or if it's scientifically proven, but I thought it was an interesting insight.
I also have a little theory about it. I know it sounds stupid, but from my personal experience, a lot of events can be traumatic for someone with anxiety. An event (or even a simple thought) that is stressful for a normal person can completely destroy me.
I had a tendency as a child to block those memories so I won't remember them and trigger a panick attack. I remember whispering to myself "forget it" 3 times and move on with something else. It came to the point that I didn't even force myself to forget. I forgot the thing right after it happened.
The point is that we probably don't remember things because we trained ourselves to forget. But that's just my theory.
Feel free to respond and tell me what you think. And if you have some sources to back up or refute what I just wrote, please share them :)
Edit : found an article on training memory suppression https://www.healthline.com/health/how-to-forget-something#how-to-forget