In the case of Harry Potter... the perception of the work tends to follow the perception of the author. There's a bunch of issues with the original books that's widely seen as problematic today - character names seen as racist [1], enough problematic gender stereotypes to warrant half a dozen of academic papers of various quality, and last but not least antisemitism that continues even into modern works such as the shofar in Hogwarts Legacy [2].
I won't deny it, I enjoyed both the books and the movies, but it's ... not something I'd just hand over to my kids one day without having a serious talk with them beforehand. Back when I was young nobody cared too much (although I do member that at least in Germany, the goblins-jews analogy was discussed a bit), but nowadays...
[1] https://7news.com.au/entertainment/harry-potter-fans-call-ou...
[2] https://theconversation.com/how-hogwarts-legacy-video-game-r...