It's pretty rare but there are some medical conditions where an XY individual is to all outward appearances a normal or even a very attractive woman, to the extent that even a doctor would not know anything was wrong until they ran some tests.
For exceptional conditions, an exceptional standard can be used. For the other 99.9% of the population, the X-Y chromosome thing works.