It is said that the past is a foreign country. But after the Brexit referendum, it is the present, not the past, where we do things differently. No government in British history has taken such a Commons beating as Theresa May suffered on Tuesday. Yet, 24 hours later, the selfsame MPs who had thrown out her UK-EU Brexit deal by 432 votes to 202 now handed her premiership a fresh lifeline. The 118 Conservative MPs who voted her policy down on Tuesday backed her on Wednesday, as though it were the most natural thing in the world to do.

By voting by 325 to 306 that they still had confidence in May’s government, the House of Commons turned the ordinary meaning of words on their head. But this wasn’t a vote of confidence in any normal sense. It was a suboptimal tribal choice between a government led by May and one led by Jeremy Corbyn. It was a knockabout partisan diversion from the main national issue, which now resumes. The loss leaves Corbyn with fewer defences against Labour’s second-vote campaigners. But the victory also finds May still wedded to her defeated Brexit policy, and settled in for another year in Downing Street.

She may be the least worst leader the Tory party has on offer, but she’s no Ole Gunnar Solskjær with the magic touch

There is no point in tut-tutting too much about this weird inversion. The Brexit referendum has challenged parliament’s legitimacy. It’s make-it-up-as-you-go-along time now for the Commons as Britain’s representative democracy, with its traditional Burkean emphasis on the assembled judgments of individual local MPs, battles to accommodate itself to a referendum decision that most members didn’t want. Since June 2016, ministers, political parties and MPs have been continuously struggling to adjust, sometimes with the kind of bizarre consequences that we have witnessed this week.

Get used to it, because the article 50 timetable is an implacable taskmaster. There are just 72 days before Brexit takes effect, on 29 March. Every day brings a new issue for MPs to focus on. Now the attention will shift to article 50. Unless it is stopped to permit the consideration of new options, such as a second referendum, or unless the withdrawal agreement MPs rejected this week is reinstated fairly soon in a different form, with a better prospect of success, Britain will tumble out of the EU with no deal – an outcome that most MPs say they oppose but which became more likely on Tuesday night.

“What happens now?” is the question of the hour. May said on Tuesday that the government was listening to parliament. She has no alternative. But she has been a terrible listener in the past, and she has shown little appetite for serious listening in the last 48 hours either. After her win tonight she repeated Tuesday’s pledge to reach out to “parliamentarians” about ways forward. But that pledge is narrowly drawn. She remains foolishly focused on the priority of persuading Tory and DUP rebels to support her, not on looking for agreements with Labour or other opposition MPs.

Play Video 1:50 Theresa May survives no-confidence motion by 19 votes – video

The days for that partisan approach are gone. She is in this mess because it does not work. She may be the least worst leader the Tory party has on offer, but she’s no Ole Gunnar Solskjaer with the magic touch. The penny dropped during the day that she would get nowhere if she insisted, as Andrea Leadsom appeared to say this morning, that she would not talk to Jeremy Corbyn and other party leaders but would instead talk directly to Labour and other opposition backbenchers.

She can’t pick and choose whom to talk to. If she did so, she would hang them out to dry in their own parties. And she can’t insist on too many preconditions either. It is fair enough for May to insist that the goal, if she genuinely reaches out, is to deliver a Brexit opposition MPs will support. But that Brexit can only be a different one from the one she tried and failed to persuade her own party and the DUP to support this week. She has to be ready to compromise, and to change her red lines. She has to be open to ruling out a no-deal exit, to extending article 50, to a form of permanent customs union that would effectively eliminate the Northern Ireland backstop problem, and to guaranteed regulatory alignments with the single market.

If she takes that approach, she will be denounced by the Tory extreme right. But she lives with that problem already. The extreme right denounces her anyway. They vote against her, both as party leader and on Brexit. They don’t want a compromise. They want no deal. They want a bonfire of the regulations. They don’t care about climate change, the “just about managing”, the union or Ireland.

But if she reaches out in the way she has so far failed to do – and perhaps now understands that she must – she may yet get her Brexit through parliament. It is a mistake to say that “May’s deal” is dead. It isn’t. The withdrawal agreement part of last November’s UK-EU deal has widespread support in the Commons. Most MPs support its three key features: reciprocal post-Brexit rights for citizens, a settlement of the UK’s debts and the avoidance of a hard border in Ireland.

The problem for Commons moderates is with the second, shorter part of May’s deal, the political declaration on the future relationship with the EU. Here May fudged almost everything last November, kicking the can into the transition period because she is fearful of antagonising her own party on future economic ties with the EU. That fudge prevents Brexit pragmatists on the opposition benches from backing her deal. They would be buying a pig in a poke, in which they might end up facilitating a hard, deregulatory Brexit.

Labour must pursue a new Brexit deal, not a second referendum | Owen Jones Read more

Yet this is also, potentially, an opportunity for those pragmatists and for May to come together. If she and they can agree a domestic deal on the goals of the future relationship, to last until the next election in 2022, she might get her Brexit and they might get the regulatory alignment, customs union and soft border in Ireland they seek. Something similar might be achieved under a so-called Norway plus deal. If she is really daring, she might even craft a devolution-of-powers deal that the SNP, which has its own party leadership problems, might grab at, as might Welsh Labour. Tonight the SNP’s Ian Blackford, a practical man fallen among fanatics, sounded cautiously interested. All this would mean Britain leaving the EU – which is why it would stick in the throat of us pro-Europeans – but it would keep Britain a more European society.

Franklin Roosevelt was the greatest political leader of the 20th century for many reasons. One of these was his pragmatic flexibility. Roosevelt believed the seriousness of the crisis that faced America in the 1930s required “persistent experimentation”. He once said it was common sense to try a policy and “if it fails, admit it frankly and try another”. It is the profoundest political common sense too. It allows a politician to fail yet retain trust. May can hardly be compared to Roosevelt. But he wrote the playbook that she needs to follow at this dire moment.

• Martin Kettle is a Guardian columnist