This glitch happens in Pikmin if the player presses down on the D-pad while standing on top of a gate. When Olimar sleeps, he falls through the wall. If he is woken up, he gets stuck in the wall and is unable to move until the wall is destroyed. If Olimar falls through the posts holding up the gate instead of the wall, he is able to walk out.( although this is not a glitch if you throw your pikmin on top of the gate they break it down faster)
In the Hole of Heroes, on the Ranging Bloyster's sublevel 7, there may be two gates side-by-side. If one gate is destroyed, and Pikmin are thrown on the side where the other gate is, they will mysteriously land on the wall, and the other gate will come down.