Director M. Night Shyamalan's latest film, Split, about the horrific machinations of a man with more than 20 personalities living inside his brain, debuted last month to critical acclaim and box office success. That was surely a welcome surprise for Shyamalan, after the director known for crafting twist endings had had become something of a punch line over the past decade as he suffered through a string of commercial and critical failures.

It's a horror story Pennsylvania taxpayers, too, who continue to subsidize the filmmaker's career.

A state-run program that subsidizes film and television productions gave Shyamalan, a Pennsylvania native who often sets and films his movies in the state, more than $12 million in tax credits for The Happening, his 2008 film about trees that try to exterminate humans (it's actually worse than it sounds). Shyamalan scored another $36 million from Pennsylvania for his 2010 adaptation of The Last Airbender, a movie probably best remembered for the controversy surrounding Shyamalan's decision to cast white actors as Japanese characters. It drew devastating reviews—Roger Ebert called the film "an agonizing experience in every category I can think of and other still waiting to be invented"—and topped many "worst film of the year" lists.

For Split, though, Pennsylvania granted a mere $2.6 million in tax credits.

There's no relationship between the quality of a movie and whether or not it gets subsidies, of course. Split got a smaller subsidy because it had a smaller budget than Shyamalan's two previous special-effects-laden films. In all three cases, though, lawmakers should be asking why the subsidies were needed at all. Even Airbender, for all the terrible reviews, made more than $310 million at the box office. Split has made more than $100 million so far, more than 10 times its budget of just $9 million.

Shayamalan doesn't need welfare. The director lives at Ravenwood, a 1937 Georgian Revival mansion on a 125-acre estate (which he bought for $17.9 million in 2012, moving up from an $8 million mansion in the Main Line) just west of Philadlephia.

Supporters of film subsidy programs argue that luring major movie productions away from Hollywood can boost local economies and create jobs. These programs have flourished over the past decade, but research increasingly shows that these subsidies are costly and ineffective at creating jobs, with many of the benefits often redirected out-of-state.

Pennsylvania hands out $60 million in tax credits each year to lure movie and television productions to the Keystone State. Some state lawmakers want to giveaway more. The tax credit functions as a 25 percent rebate on practically any expense connected to filming in Pennsylvania, from catering lunch for production crews to buying camera equipment, but to qualify a project must spend at least 60 percent of its budget in-state.

Since creating the tax credit program under Gov. Ed Rendell in 2004, Pennsylvania has subsidized films that turned into major hits (Silver Linings Playbook got $4.4 million) and laughable flops (After Earth, Will Smith's disaster that was supposed to launch his son's career, got more than $20.4 million). The list includes critically-acclaimed films (Foxcatcher, an under-the-radar 2015 Oscar nominee, got $5.4 million; Fences, nominated for four Oscars this year, got $6.5 million) and movies that you'd only see if someone was paying you to do it (like the aforementioned Airbender).

Home shopping giant QVC is possibly the only entity to get more mileage out of the program than Shyamalan. Based in Chester County, Pennsylvania, QVC has received more than 60 different subsidies through the film tax credit program, accounting for more than $45 million, according to the state Department of Community and Economic Development's "Investment Tracker" online database.

Even the president has benefited from Pennsylvania's film subsidies.

Donald Trump's Fabulous World of Golf, a short-lived Golf Channel program that basically served as an extended infomercial for Trump-owned links around the world, received two subsidies (one for each season of the show) totaling $379,000 in 2010 and 2011. The show was produced by a Philadelphia-based production company.

A new report from Public Source, a Pittsburgh-based investigative journalism outfit, uncovers some startling problems with the film tax credit program—problems that go beyond the obvious one of asking taxpayers to subsidize multi-million-dollar productions that obviously don't need the help.

Because money is fungible and tax credits can be passed along from production studios to contractors and vendors, the Public Source analysis tracked how the tax credits were actually used. They found that 99 percent of all film tax credits were sold by production studios, often to businesses that have nothing to do with film or TV, essentially turning the film tax credit into "a backdoor tax break for some of the largest corporations and utilities operating in Pennsylvania."

"Out of $521 million in tax credits, we could only find evidence of about $3.5 million being used by film companies to offset their Pennsylvania taxes," they reported.

When Public Source asked the department to "detail any figures or metrics that it uses to evaluate the success or failure of the film tax credit program," its questions went unanswered. "The department also did not say how it evaluates which productions should receive a tax credit and which ones should not, which raises questions about the type of metrics used to evaluate the applicants," Public Source reported.

Policy expects on both sides of the aisle, who rarely see eye-to-eye, agree on the wastefulness of film subsidy programs.

"Jobs in the film industry are highly skilled and mobile, which means they do not create lasting economic benefits. If another state rolls out an even more generous tax credit, film production can simply pack up and leave for another soundstage. States that decide to shower the film industry with taxpayer funds are in a race to the bottom, as no credit is high enough to satisfy Hollywood executives," wrote Jared Meyer, a research fellow at the Manhattan Institute, a free market think tank, in a post for Reason last year.

Similarly, progressive groups like the Center for Budget and Policy Priorities have opposed film tax credits as a poor means of generating economic development and for padding Hollywood executives' pockets. "The film industry claims that they create jobs for local residents, but the most serious study of this issue found that out-of-state specialists — actors, writers, cinematographers, and so on — reap a disproportionate share of the benefits," wrote Robert Tannenwald, a professor of economics at Brandies University, in a 2011 report for CBPP, where he was a senior fellow at the time. "Residents get relatively low-paying jobs that disappear once a shoot is finished and the producer leaves town."

Some states have capped, limited, or even eliminated their film subsidy programs in recent years as criticism has grown. In 2009, when film tax subsidies peaked, 44 U.S. states, along with Puerto Rico and Washington D.C., offered some form of film or TV production incentives, according to the National Conference of State Legislatures, which tracks state-level polices. By 2016, however, only 37 states still had film tax credit programs on the books, and many of those states had decreased the level of funding or limited how much a single project can receive—like Louisiana's newly approved limit of $30 million per project and $180 million per year.

Other states are expanding their subsidies, including California, which seems like the place least likely to have to incentivize the making of movies. Lawmakers there tripled the state's film incentive program budget to $330 million.

These programs persist because of the power of lobbyists and the appeal of the bright lights of Hollywood. Sometimes the two are one and the same, like when actor Kevin Spacey helped whip up votes in the Maryland state legislature for an expanded TV and film tax credit program in 2014. At the time, Spacey's popular Netflix show House of Cards (about the dirty side of politics, fittingly) was filmed in Maryland and producers were threatening to leave for California unless they were granted additional tax breaks from the state.

They got them.

Night Shyamalan has not had to resort to such tactics. The big twist here is that both parties have allowed Pennsylvania's subsidies to keep flowing—in July, the Republican-controlled state legislature and Democratic Gov. Tom Wolf agreed to expand the state's tax credit program to $65 million annually.

"Tax credits and subsidies, whether for Hollywood studios, alternative energy companies, or sport stadiums, flip the free market on its head," says Nate Benefield, director of research at the Harrisburg-based Commonwealth Foundation, which supports killing Pennsylvania's film subsidy program. "Businesses no longer succeed based on who has the best product, but who hires the best lobbyists."