Pet axolotls can become terrestrial salamanders. It is called morphing. The only reason they tend to die when doing so is that it is extremely rare to get one that morphs and their owners don’t realize how different the proper conditions for a morph are.
Morphing only happens with captive axolotls because they contain a small amount of DNA from tiger salamanders. The reason for the dna is that the captive population of axolotls hail from a small number of originally captured individuals, resulting in a founder effect, i.e., low genetic diversity. Scientists bred a in a closely related species, tiger salamanders, to try and diversify the genes. Since those salamanders morph, that gene is triggered on rare occasions among the descendants. Morphed axolotls can live full healthy lives.