They cast this girl as Hermoine, KNOWING there would be backlash. They have already seen how nutjobs on the internet behave, and they cast this girl knowing full well she will receive hate and abuse over the role, potentially for years. They are willingly subjecting her to it, either because they don't care, or more likely because they want to use that hatred to fuel the news cycle. They didn't race-swap Harry or Ron (even though Ron is a ginger) because they knew that hatred toward a girl will be better for the optics.
This is the casting equivalent of staking a lamb down and leaving it to the wolves.
I know Anon Babble is already having a field day with this, but I want to make this point and don't want it to just get buried in one of a dozen other threads.