This glitch involving the Puffstool and Mushroom Pikmin can be executed two different ways, each with slightly different results, but both involve Mushroom Pikmin either attacking the Puffstool or breaking free of its control.
The first and easiest way is to knock a Pikmin to the ground at the moment it gets infected by the Puffstool's spores, most easily done by throwing them on top of a Puffstool which has been flipped upside-down, and then wait for it to shake them off and hit them with its spore cloud. Upon standing up, the newly-created Mushroom Pikmin will become pale, as if idle, and start to attack the Puffstool. You cannot call or command these Pikmin, but they will return to normal when they are knocked down again, or if the Puffstool is defeated.
The other method is much harder to execute, but a bit more interesting. Rally your Pikmin around the Puffstool and dismiss them, or simply have them attack it. Then, call them the moment the Puffstool flips its cap to blow out its spores. If the timing is perfect, the Pikmin will turn into Mushroom Pikmin and then immediately fall into line by your side. You can command these rebels with the C-stick and direct them to carry objects or even attack enemies, but they cannot be thrown or dismissed, and they will revert to normal Pikmin as soon as they have completed a task. Be careful not to bring normal Pikmin anywhere near the Mushroom Pikmin, as normal Pikmin will still attack them despite them being under your control.