The tribunal heard that Upton began gender transitioning in 2022 and it was agreed with a supervisor that the medic would use the female changing room after starting work at the hospital in August 2023.

The legal team representing both NHS Fife and Upton argued the doctor “is a human being who is just doing a job” and had been drawn into this difficult legislation despite having permission to be in the female changing room.

The tribunal ruling stated that NHS Fife should have stopped allowing Upton to use the female changing rooms on an interim basis after Peggie’s complaint.

The 312-page judgement found in Peggie’s favour on four counts but dismissed her other claims against both the health board and Upton.

It also said that comments made by Peggie to Upton amounted to harassment.

After the ruling, Peggie vowed not to “give up her legal fight” and her legal team have since confirmed they would appeal the ruling as well as two corrected versions of it.

The nurse said the ruling “fell short” after allegations of discrimination and victimisation were dismissed.