My post below elicited this response:
Here are a couple of cases which seem to defy easy classification.
A “chimera”. This is a person who has cells derived from two zygotes. It can happen if two fertilized eggs merge very early in development. The individual may appear entirely normal (there may be chimeras reading this who are unaware of their condition); but the cells in their body will come from two quite distinct origins. If the original zygotes were male and female, then the adult individual will have some cells in their body with the XY (male) chromosomes, and others with the XX (female) chromosomes. There may be no external sexual ambiguity as long as the sex organs all come from the one lineage; in general all kinds of sexual ambiguity might arise.
Second case; more common (though still unusual) is where an individual is genetically of one gender, and phenotypically of the other. This can be either an XX individual who develops with external male genitalia; or XY who develops with female genitalia. This is usually caused (I think) by excess or deficit of the appropriate hormones during fetal development.