Sadly mental health issues are not something you can control, any more than a broken leg. They happen, and need fixing. What those athletes are doing is putting extreme pressure on their bodies, and trying to do that while not focused could lead to life changing injuries.
I do understand the fear that some might use 'needing to look after my mental health' as an excuse not to do something they would rather not, but in this case after years of preparation, I imagine the poor girl must be absolutely devastated to have to pull out, and she has all my sympathies and wishes for a full recovery.