Now that I've calmed down a bit, I can talk about it.
Last week I went to a local Social Security office and talked about changing my name and gender on their records, just as I did on my driver's license. I presented all the evidence in my arsenal: my license, letters from work, therapist, doctor, etc. and tried to calmly explain what the situation is.
I was told in no uncertain terms that no changes can be made until I have "the operation". I explained that there is no such thing, and that the particular surgery they're requesting is not possible, but the woman told me that's their policy and there's nothing they can do. So it's the same problem as with the passport office.
The disturbing thing is that she also suggested I commit fraud - this from a government worker. She said I should get a letter from a surgeon confirming that I have had such surgery ("no one is going to examine you to prove it")! I told her that's fraud, both me and the doc can end up in jail and I'm not going to add legal problems on top of everything else.
So now I've been half-seriously considering moving to another country where the government doesn't have its head up its ass. Why should I be loyal to a country that doesn't want me?