Many New Yorkers thought Amazon bailing on their second headquarters in Queens was a catastrophe, dashing the city’s hope for 25,000 jobs and a multibillion-dollar economic boost.

But Pat Garofalo thinks we had a lucky escape. “There’s a long history of companies saying, ‘We’ll do all this stuff if you give us this money,’ and then they just don’t do it,” says Garofalo, author of the new book, “The Billionaire Boondoggle: How Our Politicians Let Corporations and Bigwigs Steal Our Money and Jobs” (Thomas Dunne Books), out Tuesday.

The recent debacle of tech conglomerate Foxconn in Wisconsin is the perfect example, he says.

“Foxconn said, ‘We’re gonna create 13,000 jobs in Wisconsin,'” he says of the company that received a $4.1 billion subsidy from the state.

“Then quietly, six months later, it was, ‘Actually, no, it’s just a couple thousand, and also never mind about that plant we were planning to build.’ You need to take [claims like these] with a grain of salt.”

“The Billionaire Boondoggle” shows how taxpayer money lavished on companies to entice investment and jobs rarely offers returns worth the cash.

The entertainment industry is one of the worst offenders, with the Netflix hit “House of Cards” being a premium example.

The show was filmed in Maryland, thanks in part to “a generous subsidy program provided by the Maryland legislature,” Garofalo writes.

But as the show’s third season approached in 2014, some lawmakers started questioning why taxpayer dollars were funding a global behemoth like Netflix.

The response was swift. Charlie Goldstein, an executive at the show’s production company Media Rights Capital, sent a letter to Maryland’s then-Gov. Martin O’Malley, saying the show wouldn’t film for several months until “sufficient incentives” were made available. If not, the letter said, production would have to “set up in another state.”

The company even sent the show’s star, Kevin Spacey (pre-scandal), to wine and dine state representatives, leading to excited coverage in the local papers while setting the stage for a bitter response from the public if the show left. In the end, Maryland gave in, granting the show $19 million in tax credits and other perks.

“It’s no surprise the legislatures ultimately caved, as Hollywood has gotten very, very good at wringing public dollars out of governments via these sort of threats and their attendant media campaigns, lobbying efforts and even biased economic impact studies,” Garofalo writes.

“It’s all part of the blockbuster scam, the many and various ways in which taxpayers are being ripped off by the film and TV industry.”

HBO’s “Veep” received $14 million in subsidies from Maryland over its first three seasons. But when California dangled $6.5 million for just one season in front of the producers, they moved the production, leaving Maryland high and dry.

In 2015, the Maryland Department of Legislative Services found that “in a backfire of epic proportions, the state’s film credit shrank the state’s GDP by millions of dollars; personal incomes over the long run were lower than they would otherwise have been, too,” Garofalo writes.

Louisiana was the first state to formally offer subsidies to the TV and film industry in 1992 and set up the Louisiana Motion Picture Investor Tax Credit program in 2002. On the face of it, the program appeared to be a success: Just one movie was filmed there in 2002 compared with 54 in 2007.

But the program ended up costing Louisiana taxpayers $1.5 billion over the last decade while recovering nowhere near that, much less returning any profit. “One analysis found that the state received about $44.3 million in revenue — state and local taxes combined — in 2010 thanks to its film program, which cost nearly $200 million that year,” Garofalo writes.

A similar analysis in 2012 came to almost the same conclusion, with $200 million in expenditures returning around $50 million in revenue, he notes.

In 2005, Louisiana’s chief economist, Greg Albrecht, found that “the state only recouped about 16 percent to 18 percent of the cost of its film subsidies through tax revenue.”

And that was one of the better returns.

“Maryland found that its film-subsidy program recouped just 6 cents in revenue for every dollar spent,” Garofalo writes. “For Massachusetts, it was 13 cents, New Mexico 14, and South Carolina 19. Few independent analyses have found a return that cracks 30 cents per dollar spent.”

Sports companies are no better, as billionaire team owners routinely cajole cities into paying millions of dollars for new stadiums that aren’t even needed — and which always fail to give back in revenue, Garofalo says.

Atlanta’s Turner Field was built for the 1996 Summer Olympics, then became the home stadium of the Atlanta Braves. In an all-too-common trend these days, the team “began agitating for a new one” less than 20 years later.

Cobb County taxpayers kicked in $300 million for the new SunTrust Park, which became the home of the Braves in 2017.

At the time, county chairman Tim Lee declared that taxpayers would receive “a 60 percent annual return on investment” and that the stadium would provide returns in its first year.

Neither of those things happened.

“As Atlanta Journal-Constitution reporter Meris Lutz calculated, the annual debt obligation for the stadium for county taxpayers is some $16 million per year, which the revenues don’t come close to covering,” writes Garofalo.

To make matters worse, these stadiums are often funded through 30-year bond issues, meaning that teams will start lobbying “for a new home when their city is still paying off the old one.”

The NFL’s Rams, which moved from Los Angeles to St. Louis and then back again, left Missouri taxpayers on the hook for $144 million, “which won’t be paid off until five years after the Rams were firmly ensconced on the West Coast.”

Major sporting events like the Olympics are also financial black holes that are almost never worth the hassle.

Part of the reason it’s hard to quantify a financial boost from sports is what economists call “the substitution effect.” In short, consumers who spend money at a game often would have done something else on that same day anyway, like going out to dinner or seeing a movie. So, in those cases, no new economic activity has been created.

Another problem is called “crowding out,” a very familiar experience for New Yorkers. If you’ve ever decided against visiting a restaurant or bar because you thought it would be too busy, then the money you didn’t spend was crowded out.

When Salt Lake City hosted the Winter Olympics in 2002, there was no increase in hotel occupancy rates or airport arrivals, showing that “perhaps as many tourists were scared away from the city as enticed to visit.” In South Korea that year, where the soccer World Cup took place, “the number of European visitors coming in was directly offset by a decrease in the usual number of Japanese visitors.”

So, in addition to cities spending hundreds of millions preparing for an event like the Olympics, which often includes the building of new stadiums, they lose business at hotels, stores and restaurants from customers scared off by tourist madness.

“The European Tour Operators Association in a 2006 report found that hotel occupancy rates actually declined in Atlanta and Sydney when the Olympics came to town, compared to years in which they weren’t playing host,” Garofalo writes.

In fact, Garofalo quotes a 2002 study in the Journal of Sports Economics that claims “professional sports appear to have a detrimental effect on local economies.” Further, it states, “the departure of a franchise in any sport … has never significantly lowered real per-capita personal income in a metropolitan area.”

With this in mind, Garofalo hopes that taxpayers and politicians wake up and realize that corporate subsidies are never a smart way to boost a local economy.

“If you use that money on things like boosting your education system or building good infrastructure, you’re going to attract companies anyway and you’ll make investments that will pay off in larger ways over the long term,” he says.

“As a state, you want to make investments that really put a foundation under your economy. Paying off companies one at a time to move there is not doing that.”