I want to reiterate this addition, because it's something that's been bothering me a lot about this discussion: death of the author is a tool of literary analysis. It means that you are putting aside authorial intent in your analysis. So saying "you can't apply death of the author to J. K. Rowling" is very wrong. You can and should apply death of the author to Harry Potter, otherwise we would not be able to discuss all the racism, misogyny, antisemitism, transmisogyny, orientalism and classism baked into the text, since 1) she, the author, would never admit to reproducing these biases in her text intentionally and 2) since she would not admit intent, an analysis that prioritized authorial intent wouldn't be able even consider these issues, since it would have to recognise them as unintentional, subconscious biases, and therefore, according to the authorial intent criteria, dismiss them altogether. This is why death of the author is so instrumental to literary analysis. It allows us to stop arguing endlessly about what the author wanted to do with a text, and focus on what the text actually achieved. And in the realm of an author's biases, it allows us to criticize, firmly. Because if you say, "Well, J. K. Rowling didn't mean for the goblin bankers to be antisemitic caricatures," I can say, death of the author; her intent is irrelevant. The goblin bankers are antisemitic caricatures.
What death of the author theory isn't, is your permission slip to buy Harry Potter merch and make fandom content promoting it without sparing a single though to the trans people, and especially trans women, that you are helping fund the disenfranchisement of in the process. And it definitely isn't, as too many people have come to use it since it got attached to Rowling's name, its opposite: a reader's permission, no, right, no, imperative to interact with any text they like completely uncritically. That, I would more aptly call death of the reader.