I would think yes. If it's like the police thinking on this subject, and also because prison officers can make arrests. Not sure what the legislation is for this but for police officers it's PACE - police and criminal evidence act. It specifically says all types of searches must be carried out by an officer of the same sex as the person detained. But then you've had "guidance" which muddies the water with gender and not sex. And now we have the Haldane judgement.
And for female officers in purportedly women's prisons, the worst has happened. This is from April 2020:
www.thesun.co.uk/news/11381963/female-prison-officers-raped-trans-rory-stewart/
FEMALE prison officers have been raped by male-bodied inmates who self-identify as trans women, said a former Tory minister.
London Mayoral candidate Rory Stewart who oversaw prisons in 2018 and 2019, made the comments when asked in an interview whether anyone who identifies as a woman should be allowed to access female-only spaces.
[[https://www.thesun.co.uk/topic/prison/
Prison]]n policies on allowing male-bodied inmates who self-identify as trans women came under scrutiny in 2018 with the high profile case of trans woman Karen Whitee who attacked two inmates after being moved to a women's prison.
White, who was born Stephen Wood, was handed a life sentence for two rapes outside of jail and two sexual assaults on women in HMP New Hall, Wakefield