The $110 million live-action remake of the anime classic Ghost in the Shell is now poised to ghost from theaters. Following a horrendous $19 million U.S. opening, the film’s box office experienced a sharp 72% drop in its sophomore weekend of release. Some are predicting that the movie could end up losing over $60 million for its studio, Paramount. It could also be a career setback for its star, Scarlett Johansson, who first established her action-icon credibility as the catsuited Black Widow in Marvel’s blockbuster on-screen superhero universe.

So who’s to blame for the box-office bomb? A Quartz analysis suggests that the movie was likely destined for failure from the moment it cast Johansson as “Motoko Kusanagi”—over the vociferous objections of Asian-American media activists and fans of the original source material. According to my survey of a half-century of major-studio films that have cast white actors in roles originally imagined as characters of color, the phenomenon is strongly associated with box-office disaster.

In particular, over the past decade, there have been 18 major studio releases that prominently feature “racially dysmorphic” casting, from 2008’s 21 (which re-imagined a team of mostly Asian-American blackjack players as white characters played by Jim Sturgess, Jacob Pitts and Kevin Spacey), to last year’s Doctor Strange (featuring Tilda Swinton as a white, female Ancient One) and Gods of Egypt (with Gerard Butler as Set, an Egyptian god by way of Scotland), all the way to this year’s Ghost in the Shell. (For the purpose of this analysis, only films that feature white performers in culturally inexplicable settings or depictions, or made to look nonwhite through cosmetics, have been included—not remakes that effectively relocate the narrative into a new setting or situation.)

Of these 18 films, only six were profitable. Of the profitable ones, only three—21, Doctor Strange and Star Trek: Into Darkness (featuring Benedict Cumberbatch as Khan Noonian Singh)—could be rated unqualified hits. But even given these successes, the 18 films will have collectively lost nearly half a billion dollars for their studios, accounting for production and marketing expenses—a staggering amount, even in today’s go-big-or-go-home Hollywood economy.

(A note about my calculations: The standard rule of thumb for Hollywood movies is that total costs are double the production budget, including marketing. The profit margins below include estimated marketing costs; box office and budgets are sourced from Box Office Mojo and The Numbers.)

So what accounts for this epic failure of movies that feature “whitewashing” and “cosmetic racism” (e.g., yellowface, brownface and blackface)? There are several reasons why these movies tend to fail.

The first explanation is the simplest: Audiences are increasingly rejecting whitewashed movies. In the age of social media, race-related controversy tends to generate widespread, viral response. A quick analysis shows that in the two weeks before Ghost in the Shell’s release, there were nearly 35,000 posts on the topic of “whitewashing” on social media, generating over 680,000 reposts and replies; these posts were five times as likely to be attacking the phenomenon as defending it. Paramount admits that the negative buzz helped to shape critical opinion of the film, and potential ticket buyers were unquestionably driven away as a result.

Then there’s the fact that casting white actors in nonwhite roles presents significant narrative challenges. Some movies come up with dubious conceits in order to make minority roles suitable for white actors. Ghost in the Shell’s bizarre plot twist reveals “Major Mira Killian” to be the brain of Japanese teenage runaway Motoko Kusanagi, planted in a Caucasian robot shell. Others simply refuse to explain the racial asynchrony — as 2015’s Aloha did in casting Emma Stone as part-Chinese “Allison Ng,” and last year’s Doctor Strange did with Tilda Swinton. Still others use prosthetics and makeup in an effort to change the features of white performers, invariably with horrific results. The jaundiced, elfin appearance of Joel Grey as martial arts master Chiun in the 1986 action dud Remo Williams is fuel for nightmares (Grey was nominated for a Golden Globe for the role!). And the less said about Hugo Weaving and Jim Sturgess’s Spock-from-Hell yellowface appearance in 2012’s Cloud Atlas, the better. This dissonance comes with a cost—making it harder for audiences to suspend disbelief, and derailing the authenticity of the cinematic narrative.

Lastly, whitewashed movies tend to be extremely expensive. There’s a direct relationship between big-budget movies and whitewashed roles: Studios typically believe that, barring a handful of exceptions (like, say, Will Smith), only white actors can reliably “open” a blockbuster. The settings of movies that feature white actors playing nonwhite roles are also generally exotic vistas or elaborately imagined futuristic societies, requiring costly location shoots or heavy use of CGI.

Yet despite clear evidence that whitewashing doesn’t pay off, studios continue to make the same mistake, year after year. In fact, since the 1960s, the number of racially dysmorphic major-studio films has steadily increased, from six in the 1960s and 1970s, to 10 in the 1980s and 1990s, to 18 so far in the 2000s and 2010s.

The exercise may well have been reasonable (if still ethically questionable) half a century ago. The six films tallied from the civil rights era generated, on average, over 150% of their costs in net profits. But the 10 films released during the era of multiculturalism earned just 13%. And the 18 released in our present “postracial” era have on average lost 10% of their budgets.

Upcoming projects like Netflix’s mostly-white live-action remake of the hugely popular manga series Death Note, and Warner Brothers’ long-discussed live-action remake of another anime classic Akira, make it clear whitewashed narratives won’t go away soon.

That’s a shame, because all the evidence suggests that the cycle—in which big-budget movies seek out big-name (white) stars—is easily broken. Get Out, Jordan Peele’s brilliant $4.5 million horror movie starring the relatively obscure black actor Daniel Kaluuya, may end up as the most profitable movie in a generation, having grossed $186.3 million worldwide to date. The Fate of the Furious, directed by veteran African American filmmaker F. Gary Gray and starring a multiracial cast, just opened with the biggest weekend box office take in history.

Meanwhile, Asian-Americans now spend the most per capita on movie tickets of any demographic in the US, followed closely by blacks and Hispanics. (People of color bought 55% of all tickets for the last Fast and Furious outing!) And Chinese box office revenue is expected to surpass that of the US for the first time in 2017. The future of the film industry lies in nonwhite audiences. Isn’t it time for Hollywood studios to stop biting the hand that feeds them?