I'm just working my way through it now but it is a thorough analysis by Dr Michael Foran who lectures in Public law at the University of Glasgow.
I think this highlights one of the key problems:
"In ordinary parlance, sex refers to one’s biological sex - male or
female. Gender is generally much more contested. To some, it simply
connotes biological sex. To others, it refers to the social norms and
expectations which attach to one’s sex in a given socio-temporal context,
often amounting to stereotypes. Further still, and increasingly popular,
is the claim that gender is an individual identity, which one either finds
(discovers) or asserts (chooses), or perhaps even both.
It might seem as though it should simply be up to every individual
to decide how he or she wishes to conceive of sex, gender, and the
relationship between them. But if legal rights and obligations are grounded
in one or both of these concepts, then neutrality is not an option. These
are not simply different concepts. They are rival conceptions of the same
concepts."