What about people that produce neither?
It doesn't say "people who belong to the sex who creates", not "people who create".
It was clearly an attempt to avoid the issue with XXX, XXY, XYY, etc chromosomed people, but this semi-scientific way of attempting to describe it doesn't actually work any better.
Setting aside that, at conception, you're not a
person but literally one cell, by definition (and claiming that as the point of personhood opens a billion other cans of worms), there's no way to determine what sex a zygote or gamete belongs to at conception...other than chromosomal checks.
How is this supposed to be enforced? How is this supposed to be proven?
How is this even intended to work?
Oh, right, it isn't, it's just a way to criminalize anybody not to their liking and make discrimination easier.