I wasn't misgendered anywhere in the courthouse - not by the judge, the clerk or anyone else. The judge called my case by my old legal name, asked a few questions, signed the order and handed it to the clerk.
My court hearing was for name change not gender marker. For that matter, it is legally possible to have Ken as a female name and Kendra as a male name.
And I returned the courtesy. People in line before me addressed the judge as "sir" but I used the gender neutral term "your honor." Ya never know who out there might be gender stealth - even a judge. They do show up at work in a robe.
I wasn't sure what to expect but I'm fine if someone addresses me as "taxpayer".