“The legal risk remains that … the United Kingdom would have, at least while the fundamental circumstances remained the same, no internationally lawful means of exiting [the backstop].” And with that verdict from attorney general Geoffrey Cox on the modified withdrawal agreement, the chances of Theresa May’s deal getting through the Commons this evening have receded to almost nothing.

The chances were always slim. But if Cox had declared that the concessions May had obtained – in the form of an addendum to the original withdrawal agreement – were transformative in terms of the backstop, the prime minister had hoped to be able to rally enough MPs behind her deal to at least minimise the scale of her defeat to less than 50 votes. This would have left the door open to her to bring back her deal for a third meaningful vote next week.

But it would have been a stretch for Cox to argue that the backstop has substantively changed on the basis of what May secured. As Jean-Claude Juncker said last night – and the confident noises from the Irish prime minister, Leo Varadkar, this morning underline – the legal add-on May has agreed with the EU27 does not undermine the backstop as an insurance policy for the Irish border.

With the deal all but certain to be decisively defeated tonight, the real question is: what happens next?

In some ways, it’s amazing that May and her negotiating team carried on with Monday night’s charade. They must have known behind the scenes that what they secured had little chance of persuading Cox to shift his advice. He is clear that the extra concessions May secured, together with the UK’s unilateral declaration, reduce the chance of the UK being indefinitely trapped in the backstop. But it’s far less than what she was hoping for, and the advice gives cover to sceptics in the European Research Group (ERG) and the DUP to vote against the deal. It was a gamble; one that’s backfired badly.

With the deal all but certain to be decisively defeated tonight, the real question is: what happens next? For May, the most likely route to her getting her deal through would be to ask for, and secure, a three-month extension of article 50 until the end of June. With European elections scheduled to take place in May – and no plans for the UK to take part in them – the kind of longer-term extension that would be needed to pave the way for a second referendum or a fundamental rethink of May’s deal would be much, much harder to make happen once we move past the European elections. As May herself has observed, this would create a much sharper cliff-edge, giving MPs a binary choice between her deal or no deal.

There are two big obstacles hanging over her though. First, if she loses big this evening, her position will become increasingly precarious as the week goes on. Although she can’t be formally challenged as leader of the Conservative party until December, she may come under intense pressure from a coalition of both former remainers and hard Eurosceptics in her cabinet to step aside. If that happens, expect chaos to ensue. We could well arrive at a default no-deal outcome – indeed, that’s what those in the ERG and DUP who end up denying her support today will be banking on.

The second obstacle is whether MPs in favour of a referendum or a softer Brexit would let her get away with asking for a three-month extension in the knowledge that it would simply increase her chances of getting her deal through. A cross-party coalition of MPs, led by Peter Kyle and Phil Wilson – quite probably with the formal backing of the Labour party – will be ready and waiting to table an amendment offering to support her deal in parliament to get it over the line, but only on the condition that she puts it to voters to ratify or reject in a referendum.

So for MPs the big question after this evening will be this: are they going to let May continue to try to control the process? Or will a coalition of opponents from all sides of her own party unleash chaos on the country by getting her to stand aside? Or will they take the responsible course of action: offering to get her deal through, but only if it goes to a referendum? Nothing may have really changed in the last 24 hours. But it’s all still to play for.

• Sonia Sodha is a Guardian columnist