There are species of frogs that change from male to female, or vice versa, when there is a shortage of one or the other.
There are plants on the ocean floor that, when ready, pull up their roots, turn into a snakelike creature, and swim away.
You just think you are a single creature, but you are not.
You are made up of highly-intelligent single-celled creatures who work together for the good of the whole.
These single-celled creatures (which all life forms are made of, not just us) have been here since the very early days of our planet, and are, for all intents and purposes, immortal.
The name of this creature.... Eukaryotes. You are a Eukaryote.
The Prokaryotes started converting the gases in the atmosphere into a nitrogen/oxygen/etc..... mix, but were not that efficient at it.
They EVOLVED into Eukaryotes, which have an ‘internal engine’ which ‘burns’ fuel to ‘live’. The Eukaryotes are much better at burning and converting fuels and gasses.
This is a simplistic explanation, but look it up yourself, if you don’t believe me.
What these scientists are doing is not magic. It’s like pulling the tail off a lizard and then finding out it ‘magically’ grows back.
The ‘cells’ in your body are very intelligent, and will do most anything to survive.
Viruses are the same way, and in some ways ‘smarter’ than you or I.
What we label “consciousness” is the collective “conscious” of all the cells in our body.
So, these scientists ‘tricked’ the nematodes into altering their sex, so to speak.
You would be amazed at what any animal, even ‘humans’, can be tricked into doing, or “being”.