As a mainstream author, if you write a about characters of another race (or sexual orientation, political affiliation or religion) you’re accused or cultural appropriation (whatever the heck that is, as there seems to be no coherent answer) or pandering. If those characters also happen to be Black Hats or have any unflattering traits, you’re also a racist, bigot, homophobe, etc. etc. etc.
If you stick to writing about only your own skin color, religion, world view and sexual orientation, you’re raked over the coals for pretty much the same things.
It’s literally a no-win situation. The Kobayashi Maru.
Write the story you want to tell and don’t worry about the Social Justice Warriors. The only book that won’t offend them will be full of blank pages. Unless they’re white pages. Then that’s racist too.