I initially thought of the transgender issue as follows.
Suppose there is preexistence of the soul. Souls wait in line in heaven to be incarnated. When a child is conceived (or at whatever time ensoulment occurs, such as perhaps quickening), a soul descends into his body. The mechanism of this is of course mysterious and is certainly not crudely materialistic.
Now imagine the following picture. This world is occupied by enemy forces, the demons. The souls do not descend peacefully but as if paratroopers jumping from airplanes. They drop behind enemy lines. And the demons on earth shoot guns at them, hoping to derail their deployment. If their attacks fail, each soul will come to its properly designated body, a masculine soul into the body of a male child, and a feminine soul into the body of a female child. But some souls get hit and get off track and end up in the wrong bodies, in particular bodies of the wrong sex.
Hence the transgender mismatch.
So this is admittedly a rather fantastic story, but it’s the only way I could make sense of this phenomenon.
However, I think this opinion is wrong even on its own terms. Souls are created or descend by a direct act of God. Nature can indeed fail, and often does, but God does not. Whatever God wills comes to pass ineluctably. Therefore, there can be no mismatch between the gender of the soul and body.
If so, than the only remaining, as far as I can see, explanation is that gender dysphoria is a form of insanity. Thus, there are no “transgender” people: there are only liars and nutjobs.