There's whitewashing in Hollywood, and then there's this -- a studio exec thought it would be a good idea for Julia Roberts to play Harriet Tubman ... according to the writer of the NEW film, "Harriet."

Screenwriter Gregory Allen Howard says the ridiculous scene went down more than 25 years ago in a pitch meeting about the Tubman project. Howard says the exec told the room ... "This script is fantastic. Let's get Julia Roberts to play Harriet Tubman."

Roberts was widely considered America's Sweetheart at the time after starring in a string of hits like "Steel Magnolias," "Pretty Woman" and "The Pelican Brief."

Howard says when someone pointed out to the studio exec that Tubman was black and Roberts shouldn't play the role, he replied ... "It was so long ago. No one is going to know the difference."

Thankfully, the Hollywood honcho didn't get his way, and flash forward to 2019 ... Howard's movie about the legendary abolitionist who led hundreds of slaves to freedom via the Underground Railroad is finally in theaters.

Of course, the casting of black British actress Cynthia Erivo was also criticized ... because she's not African-American. Can't please everybody.