There's more than one species that can fully change its biological sex mid lifetime. It's not real common but it happens.
Male bearded dragons can become biologically female as embryos, but retain the male genotype, and for some reason when they do this they lay twice as many eggs as the genotypic females.