American-born Becky Kent, 51, from Dundee, found the remark on a Post-it note which officials had forgotten to remove from her paperwork.
To add insult to injury, the letter had also been addressed to "dear Sir" despite her now being a woman.
The handwritten note read: "Colin it's right! Man - changed his name to woman's name - statutory declaration attached! Takes all sorts!"
The Scottish Transgender Alliance has denounced the note saying the official's behaviour was "disgraceful" and "unprofessional".
The retired prison officer said the comments "undermined who I am as a person".
She added: "I didn't make a choice and decide 'Oh this could be fun'. It's my life. It's who I am as a human being and they've invalidated that with their comments."
A Scottish Court Service spokesman apologised and said the staff involved would be reminded of policy.