At the end of the day it's procedural errors on the hospitals end, possibly exacerbated by the standard processes not being designed with trans patients in mind. That doesn't make it the patients fault, or necessary the nurse asking the questions, depending on what the set questions were and answers given. It means the process needs to be re-examined to remove the possibly of future failings.
First errors was clearly relying on a questionnaire at all and not just testing everyone. It appears that has now rightly been changed.
Other possible issues (though just speculation)
Did the nurse know what surgery the patent was having, or was their role that day just to ask the questions to everyone having any surgery? If the latter, then they may not have realised the patient was female. That would be an procedural error of not having sex clearly noted, and could have been avoided by having more constant care givers or informed handovers.
Were the question ambitious if viewed through the lense of gender woo? Eg. "Have you had intercourse with someone of the opposite sex?". If the patent truly believes they are now a man, they may view their relationship as same sex, so answers a question like that incorrectly. While that could be avoided be the patent applying their own logic, hospitals have to deal with patients who are uninformed, have mental health issues, have strange (to me) beliefs or are just not that bright, so have a responsibility to make their systems robust enough to catch things like that. It should never depend on any patient having/applying their own sense.