Jimmy: Uh oh! You just confessed what you did, Gary. Whoops! Gary: What? Dr Crabblesnitch: Gary Smith, I knew you were behind it all. You are expelled! Jimmy kicks Gary in the ribs. Gary moans and groans as Jimmy drags him out of the office.
I think in his position, the only way Crabblesnitch could've "heard the whole thing" is if he overheard one of the students talking about it, or at least something like that.