Yes, but the character’s race was of little consequence in the story. There are stories where this is not the case (Morgan Freeman wouldn’t have been cast in the Ken Watanabe role in The Last Samurai), but they are now less common than stories where a character’s gender is important to the story. If they’d cast an Irish woman as Red, there’d have to be some explanation for why she was serving time in a men’s prison. Or else all the main characters would have to be changed to women, with the setting a women’s prison. That wouldn’t be totally unworkable, but some elements of the existing story would seem less plausible if everyone involved was a 1950s era woman:
“Andi” might have been wrongly convicted of murdering her cheating husband and his mistress, but what are the odds that the real killer would be a female career criminal? It’s also a lot less likely that Andi would have had the financial experience necessary to advise others on their taxes or launder money for them.
So either the time period has to be changed, or the plot needs to be reworked to fit with 1950s gender roles. The story might still be recognizable, but it would be pretty different from what Stephen King originally wrote.
Similarly, you couldn’t just drop a woman into any of the major roles in Saving Private Ryan because there weren’t any American women serving in combat during WWII. Pride and Prejudice falls apart if any of the Bennett sisters is actually a brother. Things are somewhat more flexible in movies with a contemporary setting where a “lady banker” would be unremarkable, but any movie with a romantic element is going to require that certain characters be of a particular sex.