The boundless walls in World 3 were intentional. Most of that level consists of floating platforms, so if you're not careful enough you might fall off.