As a big movie fan, it seems to me that you should make an effort to find actors who match the character’s gender, race, and age.
For example, I just finished watching “Far Pavilions” from 1984. Amy Irving played the Indian princess. Why? There were hundreds of talented Indian actresses available. And Omar Sharif played an Indian noble. Again, no Indian actors available? Really?
I get equally annoyed when I see black actors in movies about Medieval England or Vikings. Or when avant guarde directors start reversing roles and have males play Joan of Arc or women play Bob Dylan. It’s just distracting!!!
It seems to me if you are portraying an historical person, you need an actor who matches that person’s qualities as much as possible. If an Australian actor like Russell Crowe can pull off a perfect accent and play Roger Ailes, that’s fine. But Roger Ailes as a woman, or Roger Ailes as a Mexican, or Roger Ailes as Chinese, not so fine.
If there is some disability involved, deafness, wheel chairs, etc., there are actors around with those disabilities. They should at least be given a chance to audition for the part. With transgender people, I suspect there aren’t many around who can act to the level of Scarlett. But I would give them an audition. Gay people playing straight people and vice versa? If they can pull it off, fine.
In fictional shows, the characters should represent the actual population being portrayed. If 1/3 of the US army is Hispanic, and you’re making a war movie, about 1/3 of the actors should be Hispanic. Criminals shouldn’t be all white or all black or all Oriental. They should be proportional to the actual criminal population, as should the police. “Acting” can only get you so far. We cringe when we watch, for example, “Charlie Chan” movies from the 1930s with a white actor playing a Chinese detective, and we SHOULD cringe. Even in the 1930s there were perfectly capable Chinese actors around.