I have to say I completely disagree with this take. I totally understand with you that there are plenty of problematic elements with HP, but I think that your criticisms just aren’t really grounded in the text(s)
The idea that the wizarding world “squirrelling itself away” as some kind of “apartheid” is just bizarre. It is clearly explained several times (whenever underage magic use becomes an issue, for example) that the wizarding world went into hiding and enacted their secrecy statue as a form of protection against persecution. In fact this is one of the bits of the book with a basis in historical fact: people suspected of witchcraft were burned, hanged and generally persecuted. If they did posses the ability to hide their community away from their persecutors, it makes perfect sense for them to do so.
The wizards are not a ruling elite who attempt to impose their rules on the muggle majority (as, for example, the white SA arpartheid actually did). The only characters who want to dominate or interfere with the muggles are the explicitly evil ones. The only times that they make any interference with the non-magical world is to warn them of dangers (Sirius Black’s escape, Voldemort generally).
The attitude of the wizards towards the muggles varies from character to character but “Muggles are amusing, piteous creatures” just isn’t true. The Weasley Dad for example venerates muggles and is as much in awe of their technology as they would be of his magical powers.
Again the “apartheid” claim simply isn’t true if you consider attitudes towards marriage etc. The only characters who have issues with magical/non-magical relationships are the evil ones. In the case of Hermione, born in a non-magical family, it is the good characters who accept and welcome her and the evil ones who call her “mudblood” because of her ancestry. If the wizarding world was any kind of apartheid state then people of mixed or muggle ancestry wouldn’t get anywhere near Hogwarts in the first place.
I’m not a super HP fan. I can accept that it is problematic in certain areas. And don’t get me started on the awfulness that is the final book. But I think you’re unfair and I think that the overall messages of HP are far more positive than you are allowing.