I think you've put your finger on the glaring issue here - any law that says that someone born male becomes female at the stroke of a pen, and is exactly the same under the law as a black woman or a disabled woman, or any other woman who was never anything other than female, is obviously a failed attempt at a law.
And as the judges' questions are illustrating brilliantly, impossible to interpret and apply rationally and fairly.