I think schools will fear that they have to demonstrate (if challenged) that single sex provision is justified.
If guidance endorsed by local and Scottish government says you mustn't , and that you may face legal action, I imagine you might brick it.
I'm feeling benevolent though, so here are some more exceptions from the notes to the Equality Act 2010 which they could be inspired by. These might be more generally useful too.
Single-sex services: paragraph 27: Effect
...734. Single sex services are permitted where:...
they may be used by more than one person and a woman might object to the presence of a man (or vice versa);...
Gender reassignment: paragraph 28: Effect
739.This paragraph contains an exception to the general prohibition of gender reassignment discrimination in relation to the provision of separate- and single-sex services. Such treatment by a provider has to be objectively justified.
Communal accommodation: paragraph 3
Effect
997. This paragraph provides an exception to the general prohibition of sex and gender reassignment discrimination. It allows communal accommodation to be restricted to one sex only, as long as the accommodation is managed as fairly as possible for both men and women. It sets out factors which must be considered when restricting communal accommodation to one sex only, and provides that discriminatory treatment of transsexual people must be objectively justified.
998. Communal accommodation is defined as residential accommodation which includes shared sleeping accommodation which should only be used by members of one sex for privacy reasons.
Section 195: Sport
Effect
614. This section allows separate sporting competitions to continue to be organised for men and women where physical strength, stamina or physique are major factors in determining success or failure, and in which one sex is generally at a disadvantage in comparison with the other. It also makes it lawful to restrict participation of transsexual people in such competitions if this is necessary to uphold fair or safe competition, but not otherwise.
Schedule 9: Work: exceptions
Considerations of privacy or decency might require a public changing room or lavatory attendant to be of the same sex as those using the facilities.
A counsellor working with victims of rape might have to be a woman and not a transsexual person, even if she has a Gender Recognition Certificate, in order to avoid causing them further distress.
www.legislation.gov.uk/ukpga/2010/15/pdfs/ukpgaen_20100015_en.pdf