This is, of course, the classically designed transactivist test case.
It’s about an individual who has indeed been bullied, thus will garner sympathy.
The selected individual is a relatively harmless person (being female - male transsexuals used for such cases usually look very weak and feminine). A test case would never be brought with a big butch man demanding the desire to carry out intimate examinations on women.
However, all rolled into that history of bullying are the demands to be given “gender” privilege when assessing the question of dignity and privacy in encounters that involve others.
The fact that the management didn’t make the situation clear is irrelevant to the principle that male prisoners have a right to same-sex officers when it comes to intimate examinations.
The parts about how the law works are not very clear, but it sounds like the aim is to embed gender identity in law as if it was sex, which then creates the direct conflict we have all identified, because her right to carry out intimate examinations on men will then be entirely equal to the men’s right to have another man do it.
Any and all laws in this area need to note the potential conflicts and be very specific about which applies and where and when. As we can see with the GRA and EA in the UK, fudging the matter doesn’t work and opens everything up for a power struggle.