Unmatched actors and roles - what is the cutoff for race, sexual orientation, etc.?

What I said was

(Connery hadn’t died then).
I am talking about de-aging actors in film. I proffer no opinion in that post about whether it’s a good idea.
(Remember this was a topic at the time after The Irishman came out).
And to answer your question, and what is asked below:

…a good actor can play it well enough that the suspension of disbelief can be maintained. In the original cast of Hamilton most of the character were played by black or mixed race people and they were good enough to make it work.
In another recent movie, the Laundromat, Meryl Streep plays Latino woman. Amazingly well.
Certainly some situations will present a challenge, perhaps a insurmountable one.