Actually, there are spontaneous sex changes possible in all animals except mammals. Not that it happens with chickens (it hasn't yet anyway), and not that it happens very often. It's most common in amphibians. There are a couple of possibilities with yours: a hormone imbalance is most likely; or she/he's a hermaphrodite (rare).
Mark
Mark