IIRC, there have been all sort of weird cases in the news.
For example, a male-turned-into-female tries to marry a man, and it #1 is not allowed because the state uses chromosomes to determine who is male or female; therefore it #1 cannot marry a man.
Then a few months later, another case, it #2, turnes from male-to-female by surgery, but it #2 claims to be a lesbian formerly trapped in a male body.
Then it #2 decides to marry a female, and the state is put in the awkward position to marry to people who look anatomically like women.