"The sex of a baby is determined by its chromosome make-up at conception. An embryo with two X chromosomes will become a girl, while an embryo with an X-Y combination results in a boy,"
"The Y chromosome carries a critical gene, called SRY, which acts on another gene called SOX9 to start the development of testes in the embryo. High levels of the SOX9 gene are needed for normal testis development.
"However, if there is some disruption to SOX9 activity and only low levels are present, a testis will not develop resulting in a baby with a disorder of sex development."
"Importantly, we identified XX patients who would normally have ovaries and be female but carried extra copies of these enhancers, (high levels of SOX9) and instead developed testes. In addition, we found XY patients who had lost these SOX9 enhancers, (low levels of SOX9) and developed ovaries instead of testes."
https://www.sciencedaily.com/releases/2018/12/181215141333.htm