"It is 'wrong' to claim that human sex is determined at birth and cannot legally change, Scotland's highest court has been told."
Strangely all of that is correct.
Human sex is determined at or soon after conception, not birth.
You can enshrine anything you like in law if you have the support for it, you just look like an idiot if you insist that "legal sex" is a legitimate concept which has primacy over the reality of biological sex.
Utter wankers.