If what Xavius says is true, then I bet Peter knocks that pumpkin bomb back at Harry under the influence of the suit. That's probably what makes him get rid of it.