Sorry you got stuck! If you get stuck in an area again can you post a screenshot of the area?
Generally the path to the exit of each level isn't gated too heavily, but you might not have picked up some of the mechanics to progress through the landmark area or out of an arena. If you were stuck in the swamp I'm guessing a geyser or swamp bubble was somewhere nearby. If you see a swamp bubble just stand on it to float upwards and to use a geyser just stand on it until it blows you upwards.