So first things first, gender is a product of language, not of biology. The biological term for this is "Sex" as in "All Peafowl with large tail feathers are members of the male sex of the species."
While it's certainly possible that an animal can be born without developed genatalia and will develop as they mature, and many species are capable of changing their sex due to environmental factors, none of these qualify as a third sex (true gender shifting rarely is reversed (i.e. a male becomes a female and later becomes a male) though it's not unknown. You also have cases where some males develop characteristics typical of sexual dimorphism within their species while others develop more feminine characteristics (but retain male genitalia). This often occurs in species where males compete to breed with females in social structures. The more effeminate males develop this way to get close to females and impregnate them without having to compete against other males that have an overwhelming edge.
That all said, no biologist would describe this as a "third" or "fourth" sex, but rather a metamorphosis. After all, menopause occurs in human females at a certain age, but nobody claims that a women who goes through this process is "no longer a woman" (Or if they do, they likely quickly learned why this is a bad idea and never do it again... providing they survive the first time). Similarly, many insects have larval stages where they look nothing like their adult forms. While I will not look for information on whether you can determine a caterpillar's sex or not, (feel free to do that yourself. I'd like to not have anything related to "Caterpillar genitalia" in my search history, thank you very much.) I do have suspicions that, given the radical transformation from juvenile to adult forms, it's safe to assume that there are a lot of differences between a caterpillar's genataila and a butterfly's. Almost every animal will have a life cycle period where they are unable to reproduce for a period of time following their birth, yet no species is considered to have a "third sex" during this period.
As a rule, evolution favors efficiency (we are not Pokemon. There is not a "final" evolution of animals, there is just evolution). Sharks developed well before the Dinosaurs and didn't change all that much. Turns out, they outlasted a lot of sea life and thus had little reason to evolve. As such, sex is not the most efficient way to reproduce (that would be mitosis) but it has advantages over the other forms of reproduction in ensuring genetic diversity. Most of it's inefficiency comes from the fact that, well, it takes two to tango. So the more partners required, the more in-efficient the process becomes, and that inefficiency does not translate to any new benefits over a simpler "two player mode" while "multi-player" reproduction is way more fun than single player mode.
Another reason classifying these stages as biological sexes is not ideal is the that the juvenile and the elder do not take part in procreation. That is only possible by the adult male and the adult female. And in biology, the truest test of Male or Female is to look at the chromosomes, as all sex in every species are determined by at least one pair of chromosomes (Not all XX/XY, that's a mammal thing. Many birds, reptiles, fish and insects use a ZZ/ZW system with the chief difference being the ZZ is a male and ZW is female.). And the Duckbilled Platypus has it's sex determined by 10 chromosome pairs (because of course it does) that are still looked to all XX pairings or all XY pairings. (I'll admit that I do not know if species that change gender some how change their chromosomal pairs, but in all likelihood, that isn't happening as the changes are normally triggered by environmental factors).
In short, the species is possible on a sex level (Similar to not having three or more sexes, having two or more heads is not efficient in an evolutionary sense which is why it rarely happens, and when it does so, it rarely survives for long in the wild, but that's out of scope of this question.). But it would not be classified as a creature with four biological sexes. That said, as gender is a construct of language, not sex, if the creature is self-aware OR named by an intelligent species that recognize more than two genders (there are some societies where this happens) than they may speak of life stages in terms of gender... but it's not biological or scientifically creating sexes beyond the two.