"I never thought I would have to say this, Miss Granger," the Boggart-McGonagall said primly. "But, since you have failed all your exams, you will be expelled from Hogwarts-"
"Riddikulus!" Hermione yelped, sounding desperate.
McGonagall went silent for a moment. "Issmay angergray, oday otnay indfay isthay usingay!"
If Hermione's giggle was a bit hysterical, Harry was hardly going to mention it, and then Neville moved past her with his wand held ready.
The Boggart changed back into Bellatrix Lestrange, and less than a second later Neville cast his spell. "Riddikulus!"
At first Harry didn't even notice the change, until the Boggart-Bellatrix swept her arm up to cast a spell with a delighted cackle. Then he saw that her wand had been replaced with a large carrot, and once he noticed that he spotted more carrots spilling out of her sleeves.
The sight was absurd enough that about half the class started to laugh, and the Boggart trembled for a moment before exploding into a cloud of smoke.