She lost track of where she was in mid-air, basically? I think it's the right decision to withdraw after that if you're not in the right state of mind because as you say, it's too dangerous to continue if you're not 200% certain of yourself. Must be a terrifying experience.
But what she had (twisties or whatever it is called), how does that relate to mental health issues? Did she get it because of mental health problems beforehand, or is she having mental health problems because of what she experienced during that exercise. Or can it be both or are they not even related in the slightest, I have no clue. It's probably a lot more complicated or intertwened than I can imagine, and of course she doesn't owe any of us an explanation about any of it.
I've also seen people on Twitter slated for saying it was a bad exercise and I do think that's going too far as well. Objectively speaking from a gymnastics POV, I don't see what's wrong with such a comment (apart from a lack of empathy probably, might not be the right time or place to be making comments about that).