Ok but like- identical twins can have opposite sex, but it's very rare. It's called chimerism or mosaicism
Basically, when twins are being formed in the womb, there's a small chance that the chromosomes will kinda weird out. One twin will be missing one chromosome, and will end up with X chromosomes, while the other will end up with XXY chromosomes
The twin with X chromosomes will have female traits, while the twin with XXY chromosomes will have male traits
Anyways, this was all a segway into me explaining how Dipper and Mabel can be identical twins, and also both be trans
If you want me to elaborate, please say so