Mayor Martin J. Walsh was behind the wheel of the Grand Prix of Boston and got burned by its fiery crash, ignoring a series of repeated wrong turns and warning signs that the race would never get off the starting line.

Walsh’s administration spent a year pushing an idea that seemed ludicrous to many Bostonians: hosting a high-speed IndyCar race in a city that can’t even fill potholes or sync up its traffic lights.

The mayor also enabled the race promoters, who made repeated false claims about winning approvals and were ill-prepared to deal with the half-dozen city, federal and state agencies that controlled roads where they wanted to build the course.

Walsh, eager to show the city could host a major sporting event after the Boston 2024 Olympics collapsed, got Gov. Charlie Baker and several skeptical agencies to go along with IndyCar, letting them know it was important to make the race happen.

The mayor now could face the ire of all the thousands of race fans who bought tickets and reserved hotel rooms, not to mention the charities and sponsors that expected to benefit from it.

The cancellation also could end up costing Grand Prix of Boston investors a lot of money. The promoters spent millions trying to get approvals, and as part of their agreement with the national IndyCar group, agreed to pay a $1.5 million fine if the race didn’t come off, sources close to the race said.

In the end, the promoters didn’t even give Walsh the courtesy of a heads-up from Grand Prix of Boston CEO John Casey before Casey announced he was canceling the race.

Casey went out flame-throwing, blaming Walsh — the major champion of the race — for its demise, saying the city proved too difficult to work with.

“The relations between BGP and the city and state has deteriorated to the point where I feel we cannot run a successful race,” Casey said in an email to investors and others involved in the race.

Casey gave all the race vendors, consultants and attorneys a similar brusque sendoff, writing: “Thank you for your work. Pencils down” — another way of saying: I’m not paying you any more.

Then Casey let it be known he was taking his speedy race cars to a city that really wanted them: Providence.

But the Walsh administration and others paint a much different picture of the breakup, saying it was clear that the promoters were not telling the truth and that BGP pulled the plug after failing to meet a deadline for financial commitments.

“They were the most disorganized group I’ve ever seen,” a top Walsh official said.

Casey asked for an extension to a May 1 deadline to fund letters of credit to Massport and the MBTA, and the Baker administration responded by agreeing to move it back just five days — on the condition BGP produced signed agreements with the U.S. Postal Service and a private landowner they had long promised.

Sources said the Walsh and Baker administrations knew that would likely prompt Casey to call it quits, which he did.

In a statement, Walsh’s chief of operations, Patrick Brophy, claimed the promoters “were unwilling or unable to meet the necessary requirements to hold an event of this size.”

That might be true, but it’s Walsh who brought IndyCar to Boston, with some of his former campaign aides jumping on board the Grand Prix gravy train.

The mayor bungled it right from the start, signing an initial deal without any public input that left the city on the hook for all the street improvements, which would have cost millions.