I suppose we should ask JK Rowling why were her characters all white
They weren't. I think it's Dean Thomas who she's quite clear isn't, plus the twins Parvati and Padma clearly aren't.
Even of the main three she doesn't mention race at all. Yes, Ron has red hair, which probably restricts him to white, but the main thing mentioned about Hermione is her bushy hair-which could be various ethnicities. And Harry has dark hair and green eyes, which again doesn't link him entirely to being white. The main thing that probably links him to that is his Uncle and family by their "middle class white" style attitude.
I think that perhaps goes back to the question of can we write a character who is truly raceless? So you could happily put any actor into the part without people saying "but surely they're XXX race".
I suspect not, because the name, accent perhaps etc will give people away. Could the famous five be done as immigrants-maybe Jewish from WWII? for example. No mention of race is made, we assume from the era and their behaviour etc.
But at the same time I suspect if JK Rowling had tried to make one of her main characters a clearly different race, then she'd have been heavily criticized for trying to do something she didn't know enough about.
I remember Antony Horowitz having an article on that-and an unknown writer would be far more so. Anthony Horowitz
Historically I've a friend whose dc are on the books of a casting agency. They're non-white. She says that they get far fewer casting calls for acting-and even rarer to get through, but far more modelling calls than the white students. I thought that was quite interesting.