In my honest opinion, I think it can be related to a lot of things, childhood trauma, being influenced by things on the internet from a young age, lack of self esteem and self worth, not knowing where you fit in society, mental health issues and potentially neurodivergence.
I wouldn’t say it relates to sexuality though. A lot of the gay community don’t like being under the same ‘umbrella’ as transgender people.
I know of 2 trans people (one female to male and the other male to female) both are autistic. And I know of a non-binary (but biologically female) person who states they are neurodiverse. But that’s not to say all neurodiverse people will have gender dysphoria, they don’t. But in cases I’ve read about all of trans people are neurodiverse.
I think it’s a very complex and nuanced circumstance. The human mind and emotions are very complex. It’s not a ‘one size fits all’ scenario.
You seem like a really lovely and open minded person, so I hope the good relationship you have with them can continue.
But remember: You can respect your nieces decision to live as a ‘male’, and you can also believe she will always be biologically female, without expressing your feelings directly to them which could cause any distress or fallouts.
Best of luck x