Dumbledore's treatment of Hagrid, Lupin, and Dobby is controversial, but it's not disruptive. It's a man in authority exercising his lawful power over his own domain. This is how Rowling believes progress must only be achieved. Note that under such a system, the reconfiguration of the government is nearly impossible, and that's why for all the progress Rowling does narrate, nothing fundamentally changes in the systems responsible for all these problems. This is what Rowling truly believes was the best possible outcome. Still slavery, still second class goblins and centaurs, still rich fascists, an incompetent government, and unregulated date rape drugs. "All was well". Rowling was being honest when she wrote that.
exocrinous
If you hate the quality of Rowling's writing so much that you'd prefer to rewrite your perceptions of it, maybe you could just consume better written media to begin with. I recommend The Owl House, it does the "magic school in a problematic world" story WAY better and actually addresses the problems in the world.
As for Harry Potter, the reason Rowling is able to acknowledge her world sucks but never has her heroes change it, is that Rowling fundamentally believes disrupting the social order is bad. Once you realise that, you see the books in a different light. Hermione gets made fun of by the author for SPEW, because the author believes ending slavery is bad. This isn't a writing flaw, it's an intentional result of her worldview.
Oh, I'm misremembering. Hagrid actually goes to Azkaban during the second book under suspicion of opening the chamber of secrets. No trial, no proof, they just sent him to super jail because he likes beasties.
In the early books you've still got Azkaban set up as the punishment for criminals, even for a crime as small as having an animal without a licence. Harry Potter immediately went to the grimdark without any sense of criticality to the atrocities in its world. At least Warhammer 40K is supposed to be a satire of fascism. I feel more comfortable reading the Horus Heresy than going back to Harry Potter.
Harry Potter isn't a good book written by a bad person. It's a bad book. At Christmastime in Grimmauld Place they dress the severed slave heads up in little Santa hats and beards. Hermione makes fun of Umbridge by triggering her (probably rape) PTSD. The series ends on the line "all is well", but nobody has done anything to solve the problems of slavery, second class citizens, oppression, and fascist social attitudes that created Voldemort. Harry becomes a cop for a government that he watched fall to corruption and evil.
Instead of socialism, we should do communism