I would generally agree with you that trans rights is not, at the foundational level, a medical issue. It's a human rights issue.
Some might treat trans people as mentally ill and decide that accommodating them might be the right thing to do as a form of medical treatment, but that's certainly not how I would justify the need for trans rights.
I don't really see that kind of rationale being used when it comes to the relevant legal battles. For example, the language of the Bostock decision relies on heavily on anti-discrimination law specifically in regards to "sex", not the ADA. The relevant current of thought is that trans rights are human rights, not that they are mentally ill people that need accommodation.
Trying to medicalize the issue seems like a red herring.