Well, they gave a good demonstration of cancel culture.
I wonder with hindsight, whether instead of the teacher taking the contrary view to challenge the class, a more successful approach might have been to assign half the class (or if that would have been an unmanageable group size, then a quarter of the class - and have a separate example used for the other half of the class) to debate why its right to "cancel" views they perceive as harmful and the other group assigned to the freedom of speech side.
Because the point isn't really whether they are one side or another. It is that they think about why they and other people hold certain beliefs and how you can have engage in debate about an issue.
"We're right and you're wrong" isn't a persuasive argument.
But it is hard for adults with fully mature brains to see both sides of this issue, and it is one that teens feel particularly passionate about at the moment. So it would be difficult however they tackled it.
Maybe they need some time practicing debating issues that whilst also contentious impinge less on their immediate lives. Or if cancel culture is the right topic, maybe it needs a fictional example that people wouldn't have a reference for who was right/wrong to parrot.
On JKR's views themselves I'm surprised by the lack of curiosity her detractors have about why an author whose famous work is largely centred on exposing the injustice of bigotry and prejudice, would hold views they consider prejudiced is interesting.
Not that hypocrisy doesn't exist, but even if I didn't hold the gender critical viewpoint myself, as a fan of her works, I'd be curious as to whether she was wrong on this issue and why.
Why is it transphobic? Who decides? If she's wrong on this subject, does that mean she's a terrible person?
I am not a teacher though so I don't know how to advise your friend. It is very meta, that this issue is so contentious, that not only can we not accept people might reasonably hold an opinion that we disagree with and want them to shut up, but even discussing that happens is so contentious that a teacher proposing it is told to shut up too. 