I don't mean focus on medical situations as a wildcard to just practice any sort of (pseudo) medicine on people. It's about rights being given, not taken away.
The reason I mentioned this, is that the erasure of gender from official status might have as a side effect that rights related to gender (for example pregnancy leave) have to be defined in a way that doesn't link it to gender. By no means do I want some sort of medical laws or such that force things upon people, it's more about rights linked to a person's medical conditions.
In that sense, I see having a penis, or a uterus, or something else as just one of the medical characteristics of a person, just as for example their blood sugar, eyesight or mental state. Rights and care should be based on that, and not on a F/M on an official document.
Also, I looked up that list you posted, as some of the entries seemed very strange to me, even for the time.
https://www.snopes.com/fact-check/reasons-admission-insane-asylum-1800s/
It's an extremely funny list, but shows more that psychoanalysis in that time was pretty stupid, not that people were being put in an asylum for showing these behaviors.