I think Harry has been unfairly thrown into the role he has in the Wizarding world. At age eleven, he discovers that he is meant to save the world from Voldemort. Imagine being told that when you were eleven years old. He wants to be a normal teenager, but it simply isn't possible. Dumbledore talks to him about his destiny, and everyone expects big things from him. The fact that he has an eye for trouble doesn't help much, either. He gets thrown into it, and doesn't know to leave it alone. From the first book, and on. People actually encourage him- Dumbledore giving him the Invisibility Cloak, Fred and George giving him the Marauder's Map, Sirius encouraging him to have adventures. He takes their advice, and gets into huge trouble, but doesn't stop. This is because he enjoys it.
Harry knows he has a big role to play in the course of history, and that thought goes to his head and inflates his ego. He's been through and survived so many things, he's grown overconfident, and doesn't know when to stop. People's faith in him become blind, because they're so used to seeing the Boy Who Lived saving the day. And their disappointment is even bigger when they discover his flaws. "We though you knew what you were doing!" Ron says to Harry. Even his best friend thinks that the Chosen One always has a plan. And the reason Ron left was because he didn't.
Harry comes face to face with his flaws over the course of the seventh book, as they're looking for Horcruxes. He constantly repeats that Dumbledore hadn't told him anything, he was unsure, he didn't know, didn't know....I think Harry might have been thinking himself to be slightly invincible at Hogwarts. During the fifth book especially, they make comparisons between school and the real world. For his entire wizarding career, Harry has been at Hogwarts, at school. The real world is completely different. He doesn't know what to do, and his uncertainty overwhelms him. He depends on Ron and Hermione to help him, but when they can't, and especially when Ron leaves, he begins to fall apart.