Besides being a popular trope, it also isn’t that much out of the realm of realism. If you traveled to Earth at different times in its history, you’d literally find an ice planet (ice ball Earth theory), a swamp planet (Carboniferous period), a mostly desert/arid planet (Permian/Triassic...