@Ereshkigalangcleg
Yes, but the definition of sex isn't laid out in the Equality Act which is the point of Dadjoke's gotcha argument, so the Scottish judgement must have drawn on earlier decisions.
The definition is laid out in the Equality Act: man is a male of any age and woman is a female of any age.
It is customary and entirely accepted by the legal profession that terms that have a common meaning that is understood by people in the same way are not further defined (otherwise statutory writing would be an impossible undertaking - imagine having to define every single word!). At the time of writing the Equality Act (and now) this applied to the terms male and female.
The reason why man and woman were defined is because at the time of writing, a man with a GRC may have been understood as a woman legally. So for the purposes of the Equality Act the lawmakers clarified that the terms man and woman referred to sex, not legal status.
This is why the FWS judgement is so important, because it actually spells out and thus confirms that the Equality Act definition of sex is indeed a reference to biological sex.
For now and until it is superseded by a different higher court judgement, this is the authority on the question what the protected characteristic of sex in the Equality Act definition refers to.