Ah, I found what I was looking for. The term for this is sequential hermaphroditism, either as protandry (male to female) or protogyny (female to male). Clownfish are protandrous, and form very stable breeding societies of 4-6 clownfish with a single female at the head (but not, strictly, polyandrous, as only the most senior male gets reproductive rights); if the female dies, the next-senior becomes female to replace her. Wrasses are protogynous or protandrous based on age, and strictly speaking, many plants have a practical form of this where their sexual organs are not active simultaneously to prevent interference with the pollenation cycle (i.e. accidentally accepting its own pollen, whether or not it can self-fertilize). The Frog example in Jurassic Park is also not entirely inaccurate, in that it does actually occur in the common frog. It's just that it is very rare, due in part to the energy cost that makes it prohibitive to grow a new set of gonads. Most wrasses, for instance, don't bother, and maintain an ovarian genetic structure despite their biological gender role; the ovaries just atrophy while peripheral spermatogenic crypts appear.