3 of whatever
We've established that the majority of characters don't require specific ethnicity and the things you need to look for that are key elements that require a specific looking actor for specific roles but the OP asks why is it racist when white actors play a part that was traditionally played by a specific ethnicity actor?
That's because of under representation of actors of color.
The vast majority of roles are given to white dudes and then white women. And for no real reason. That's a hard fact of this world. So, when a role that has traditionally been played by actors of color goes to a white actor, that's not cool. People get upset because those actors of color are being excluded from the few roles they do get to play.
And the few roles actors of color do get are because of a key requirement. So, when that's taken away and the role is given to a white dude, it's upsetting.
Because, remember, it's really very few characters that require a specific skin color. And the best actor, regardless of skin color or ethnicity, should get the part. But the hard truth is that most of the time that "best actor" just also happens to be white.
So, yeah, it is racism when a white actor takes on a role that is usually/should be played by an actor of color.
Because if there's no real reason for most characters to be white then why are most characters played by white actors?
(Hint: it's systemic racism)
And if you're thinking "Well, whistlelock, aren't most people in hollywood liberals?" Yes. I think that's the case. I can be wrong, but I would bet the 'average' person working in the film industry would consider themselves liberal.
And if you're thinking, "well, doesn't that mean all those liberals are racccissssssst?"
Yep.
It does. It's called systemic racism for a reason.
Individually, those people would not describe themselves as racist. But they're still casting white actors over actors of color for no reason. Black male actors usually only get offered the part of gang members. Same with latin men. Indian American men get offered parts as long as they "do the accent."
Remember the Hector meme? actually, I'll add it. That's a perfect example of narrow roles being available to actors of color.
So, casting a white actor for a role that is traditionally played by an actor of color is usually result of unconscious racism and prejudices.