That is such a nightmare and one I hope to avoid.
I have a letter, a sworn statement, from a VA doctor stating that I have completed the necessary clinical treatments to change my gender from male to female.
I used that letter in court as the justification to legally change my name. The court found it sufficient evidence and ordered that I could change my birth certificate.
Those two pieces of evidence were sent to another state to correct my birth certificate.
That birth certificate was used to support my passport and driver's license applications.
So I have a federal employee, a court, and two different state agencies (DMV and Birth Registry) in two different states, and the U.S. State Department all confirming my name and gender. That's not to mention Veteran Medical records and disability pension, Social Security, credit reports, and banking records.
If any state agency or law arbitrarily decides it doesn't support that, it is not my records that are wrong.