There's a story in today's Times about Maggie the penguin failing to produce a chick for 8 years, because Maggie is actually Magnus. It would appear that Maggie was acquired from Denmark so presumably had paperwork identifying Maggie as female in order to be granted residency in the Cotswolds.
It also seems that Zookeepers suspicions were raised because not only did Maggie fail to provide a chick, but Maggie kept trying to mount Maggie's designated partner Frank. Even in penguin colonies, behaviour will out it seems.
Amusing as this tale may be, unlike birds, humans aren't difficult to sex. And for humans and animals alike, the sex on one's passport should be accurate.