Actually I disagree.
Why?
Cos I lived in a swing marginal seat and I was talking to people. Back in 2017 it wasn't a subject. No one knew anything about it. I did because it was a big deal to me, but at that point even I wasn't fully appreciating how bad this all was. I was still doing a lot of talking to random people about Brexit at that point (remember the 2nd Ref stuff which ultimately I felt was unwise) and in doing so talking to a lot of Labour, LD and Conservative people about politics. I didn't start being angry about Labour and the Lib Dems until 2018.
The issue that triggered problems with 'Lily Madigan and the Secret Facebook Group' not Harry Potter and the Chamber of Secrets.
The Lily Madigan incident - with the full support of Wes Streeting - sort to remove women from democratic processes and to silence them with no debate. And it went downhill from there.
Concerns about Corbyn which I spoke to people about were about defence, anti semi-semitism and taxes.
You can go be a revisionist if you want, but in 2017 JKR wasn't even going public on the subject if I recall correctly.
So quite how she is responsible for the 2017 election result retrospectively, is anyone's guess.