I think it has more to do with human childhood development, though there could be all kinds of causes.(If it were in fact a birth defect of some kind, I doubt the current atmosphere would permit even studying that...)
That view goes back to the nature vs nurture argument.
There’s also the prenatal opinion that in the stage of development of the baby in utero of hormones that help signal with the development of the sex gets fouled up by unknown chemicals which interfer of the future sex of the child.n. The so called genre affirming doctors think they replicate these hormones before puberty reinforce the primary sex characteristics by overdosing the preteen with hormones that help with the secondary sex characteristics (public hair, swollen breasts etc.). By this time it’s way too late to “correct” primary but flawed sex traits and left with a neither wholely male or female person.
At least that’s my understanding of the literature on this subject. All I know for sure is Big Med is trying to play god with the equivalent of tinker toys.