Sex change is not an instantaneous thing and may take
a few generations of same sex populations to trigger. It is not clearly understood but it has been observed for a long time. I respectfully submit a link to a 1937 publication. (see partway down the first page)
from:
www.goodeids.com/docs/Genetics_Platypoecilus_GORDON_1937.pdf
<quote>
WINGE (1923, 1927) has shown in the West Indian guppy, Lebistes, that
the X and Y occasionally cross over. In 1930 he stated that the genotypic
chromosomal constitution of XX for femaleness in this fish may be overruled
by other sex-determining factors so that the XX complex may occasionally
produce a male. These XX males when mated to normal XX females produce, as might be expected, IOO percent daughters.
</unquote>
Furthermore in his book - Livebearers: Understanding Guppies, Mollies, Swordtails, and Others; David Alderton writes - "[Females] can even undergo an apparent switch in gender at this stage as well, as the result of hormonal changes in their bodies following declining ovarian function. This phenomenon is most common in swordtails, but has been recorded in other common livebearers as well."
I suggest you try a google and make up your own mind since there is controversy on this but I personally have had swordtails and mollies "apparently" change sex and successfully mate other females to produce fry. Whether this is a REAL sex change or not I am uncertain.