A problem with the Potter series is that it is objectively disordered in a moral sense. This has nothing to do with whether Harry Potter develops morally, or how he feels about what he does, or even what people say about the moral order in the books. What matters is the objective consequences of actions. Is the moral order violated? Then the violator must suffer the consequences, however he feels. Crime and Punishment is a great book because it doesn't stop with Raskolnikov feeling bad about murdering the old lady. The moral order is affirmed only when Raskolnikov confesses his crime and submits to his sentence in a labor camp.
The consequences don't necessarily have to be legal, but they must be objective. Michael Corleone doesn't suffer legal consequences in The Godfather, but the moral order is affirmed because he ends up destroying the very thing he sought to defend by crossing over the line - his family. Not only does he end up divorcing his wife Kay, his children become strangers to him and he ends up killing his brother-in-law and, then, even his own brother Fredo.
In the Lord of the Rings, the moral order is consistently affirmed; not just in the consequences to the bad guys like Sauron, but especially when the good guys go wrong. When Pippin illicitly looks into a magic globe, he immediately suffers the consequences of his transgression - a terrifying mind meld with Sauron.
Harry Potter and his friends consistently violate the moral order in large ways and small, but there are rarely objective consequences. Sometimes there are subjective consequences - Harry might feel bad about it - but he eventually gets over it. In Ch. 16 of The Sorcerer's Stone, for example, Harry and his friends Ron and Hermione are racing to recover the Sorcerer's Stone before the bad guys get it. Neville Longbottom, another friend, stands in their way because the students are not supposed to leave the dorm. Unfortunately for Neville, he hasn't accounted for the ruthlessness of Harry Potter. Neville has prepared to defend himself in the normal physical way, but even though Harry has Ron and Hermione with him and could quickly overpower Neville and move on, he orders Hermione to take care of the problem magically, so Hermione paralyzes Neville with magic - the Full Body Bind. It's clear from the text that it is a horrifying experience: "Neville's arms snapped to his sides. His legs sprang together. His whole body rigid, he swayed where he stood and then fell flat on his face, stiff as a board... Neville's jaws were jammed together so he couldn't speak. Only his eyes were moving, looking at them in horror."
Of course Hermione feels bad about it, in fact she's "really, really sorry about this." Well, that makes it OK then, doesn't it? As long as you are sorry about it. Harry adds a little utilitarian rationalization - "We had to Neville, no time to explain", although Harry finds the time to indulge his curiosity about the spell Hermione used. His technical interest aside, Harry is indifferent to Neville's fate. The difference between Neville and Harry is that it never occurred to Neville to go outside the moral order (by using forbidden magic) to restrain Harry, while Harry is "resourceful" enough to have no such qualms. Why should he have any qualms? Unlike Pippin, Harry does just fine using illicit magic, a positive consequence that undermines the moral order that forbade Harry from using it in the first place.
It's a good exercise when reading Harry Potter to remember that most of what they do with magic can be done with normal means - the Full-Body Bind, for example, is the moral equivalent of tasering someone. Is Harry justified tasering another student (an innocent one) because that student is in the way of Harry's self-appointed mission? Is a student ever justified in tasering anyone on his own authority? Did the Potter series illustrate an objective moral order, then Harry would suffer some sort of objective consequences for this action. Maybe Hermione's spell would get out of control and they would kill Neville rather than paralyze him; or maybe they would leave him with permanent physical or psychological damage; or maybe they would simply be caught by the authorities and justly expelled from Hogwarts. As it is, there are no adverse consequences; in fact, the consequence is that Harry and friends are treated as heroes. For taking his tasering like a man, Neville is awarded ten points by Dumbledore at the end of the story. Thanks!
This sort of thing is routine for Harry Potter. What makes it problematic is that the story doesn't affirm that the moral order has been violated. It justifies Harry's transgressions - his regular lying, for example - on utilitarian grounds and leaves it at that. Lying, tasering other students, feeding them poisoned treats, lighting teacher's robes on fire... these things are sort of bad, but OK if the good guys need to do them, especially if they feel bad about doing it. This is the distorted moral order the series teaches.