Assume the first testosterone wash/lack of wash went fine and the body matches the chromosomes, perhaps perfectly male or female according to the DNA programming, perhaps just a little bit altered from the intended form but still clearly what DNA intended. The second time around, it may not work as well.
Again, sometimes this testosterone wash in an XY fetus is either very weak or sporadic. So, you get a fully, mostly or partially feminized brain in a male body. Or some parts of the brain may be feminized, others masculinized, especially in a sporadic wash. So you get different degrees of transness - those who are have fully or almost fully feminized brains are the more extreme male to female types, while those with weak or sporadic testosterone washes may be non-binary of varying types, depending on which parts of the brain was forming as those strong, weak, or non-existent testosterone moments happened.
In an XX female fetuses, the same works in reverse. There should be low to no testosterone in the fetus' system during development. If for some reason sometimes there is testosterone present, the XX fetus brain becomes masculinized to varying degrees.
Therefore you end up with a female brain in a male body, a male brain in a female body, or a mixed brain in either body. The social expectations, desires and "parts" don't match up with what the brain expects, and you get "dysphoria," the panicked feeling the brain gets when body parts aren't adding up the way the brain thinks they should, and is getting hormones it isn't expecting (or missing hormones it wants).