This was also the reason for the decision for David Reimer where after a botched circumcision maimed his penis, they decided that it was better to cut off all the genitalia and socialize the kid as female instead of letting him just live with a fraction of a penis.
There was a big-shot doctor behind it all who convinced the parents to go through with it. By many accounts he was a major creep, and also interfered with the science to support what he believed- that gender identity was fully malleable under the postnatal environment, and that it was largely influenced by examination of one’s own body.