You can't separate the art from the author. You can't. Those biases will always be found within the text and subtext of a work. But when we talk about separating the art from the author especially with things like JK Rowling I think it's really important to address the ways that just writing off an author or a work completely and never touching it actually harms people's acquisition of critical reading and thinking skills.
Let's say that instead of talking about Harry Potter we're talking about Huckleberry Fin, or Tom Sawyer, or The Lord Of The Flies. These are works that we have decided as a culture are important to teach to our children. And we teach them through the lens they were written through. When teaching teenagers about these classic works we don't say "Mark Twain had these problematic beliefs and so we're never going to finish this book" instead we say "Mark Twain had these problematic beliefs. Let's pick through the ways they affect the story and the text. Show me the bias he is presenting here. Let's look at the multiple potential meanings of this work while I guide you to the ones that are more in line with the morals I believe you should pull from it and allow you to find the morals you will take into your life with you." With Lord Of The Flies we don't say "this is a bad book with biases so we shouldn't read it" we teach kids "This person felt this way about how girls and boys interact and that's outdated information and also just his personal opinion but on a deeper layer Let's look at how that affects the story and what he is trying to say about human nature and society. Do we think he's wrong? Do we think he's right? Do we think humans are inherently violent like he does?" That is how we teach children and teenagers and even adults to sift through information and come to their own conclusions. This is how we teach people to think for themselves and identify bias in writing. Ultimately this is how you train your brain to form its own opinions.
So let's talk about Harry potter and JK Rowling. JK Rowling has beliefs that are truly detrimental to herself to society and to progression of freedom world wide but especially in the UK. That's horrible. There is no excuse for the way that she feels about things. And it is evident in her writing. I have only read the Harry Potter series by her but off the top of my head I can list several things I know are in her writing that I don't agree with. Here's my basic list (I will definitely have missed things):
• Centaurs are described with characteristics similar to native Americans. Theya re then presented as being violent, unpredictable, and a danger to women and children.
• Goblins are extreme caricature stereotypes of Jewish people who are then presented as being selfish, money driven, unpredictable, egocentric, secretive, and arrogant.
• The stairs to the girls dormitories do not allow boys in. Which not only trampled the ide of Trans or nonbinary students but also screams "boys can't be assaulted by girls"
• House elves. I don't feel like i really need to expand on this one. We all know...
• The way fleur is treated in the books is gross. The feminist "icons" of the series are incredibly mean to her simply because she is pretty and talented. It creates and underlying agression toward successful women for being pretty and successful.
• Lycanthropy should have been left alone no one needed that essay on how it's actually an allegory for Aids which then frames Greyback as an adult gay man preying on young children (Remus is 4 years old canonically when Greyback breaks into his bedroom and attacks him. Disgusting with a new lgbt connotation) also the treatment of lycanthropy in the books shows a clear misunderstanding of the actual impact of the Aids epidemic on the lgbt community.
Like I said, just to name a few. Now despite all of these things I truly love the story. You cannot remove these beliefs from it. But I would argue that rather than completely writing it off it's actually very important that we read the books through the lens of knowing these beliefs. That we point them out, pick them apart, show the ways they affect the writing. Point out the ways that those beliefs are wrong and harmful. Just as we would with any classic work. There are valuable lessons in Harry Potter. Ultimately it is a story about found family and love conquering all. It is a story of bravery and hope for a better more accepting world where you are not defined based on your blood status, physical characteristics you can't control, and traumas of your past. This is why in its way day Harry Potter was so popular with LGBT and "alternative" kids. It is important that we guide that understanding of the books through the lens of understanding the author doesn't feel that way.
When we completely write off the books and remove them from our lives, our children's lives, ridicule people for reading and enjoying them we actually remove an opportunity to develop better critical thinking and reading skills. We remove an opportunity to teach or practice bias identification in writing. But most of all we remove people's ability to come to their own conclusions about the true moral of the story.