A recent post in the political cartoons community got me thinking about Harry Potter. The punchline of the cartoon was something to the effect of "What? It's okay when Harry Potter breaks the rules to fight evil." But when I thought about it, I realized that Harry's rule-breaking has often helped evil more than hindered it. I'll give the examples I've come up with.
In Harry Potter and the Sorcorer's Stone, if Harry hadn't broken the rules by going after the stone himself, Quirrell/Voldemort wouldn't have even had a shot at getting it, thanks to Dumbledor's spell.
In Harry Potter and the Chamber of Secrets, if Harry had handed over Tom Riddle's diary over to the authorities instead of trying to solve the case himself, it never would have gotten back into Ginny's hands, the attacks would have stopped, Ginny wouldn't have been kidnapped into the chamber and Voldemort wouldn't have nearly come back to life. Granted, they might not have figured out who was behind it, so Hagrid wouldn't have gotten out of Azkaban. But then again, if Dumbledor had known about Tom's diary and if Harry had been honest with him about the voices he was hearing, he would surely have figured it out (Remember that Dumbledor, unlike Harry, already knew who Tom Riddle was and who he turned into).
In Harry Potter and the Goblet of Fire, Harry repeatedly cheated in the Tri Wizard Tournament by receiving help and advice from teachers, students and a house elf. If he hadn't cheated, he probably wouldn't have won, and thus wouldn't have fallen into Voldemort's trap and Voldemort wouldn't have returned to power. Cedric Diggory (or whoever would have won in that case) would still have been killed, but that happened anyway.
In Harry Potter and the Order of the Phoenix, if Harry hadn't broken both school rules and the law by running away and sneaking into the Ministry of Magic, he wouldn't have fallen into Voldemort's trap (again), wouldn't have needed a rescue party, and Sirius wouldn't have been killed.
It's not a hard and fast rule of course, just food for thought. I can't think of anything Harry Could have done differently to improve the outcome of Prisoner of Azkaban or Half-Blood Prince.