Who can say, hand on heart, that the customs union was uppermost in their mind in the polling booth on referendum day? Each vote contained a multitude of motives, and the subtleties of the EU’s common external tariff were in the mix somewhere, but as obscure chemical elements in a complex electoral compound. The only certain description we have of that substance, sometimes called the will of the people, is that it is made up of 52 parts leave to 48 remain. Views on what Brexit means beyond that express preferences, not facts.

Theresa May wants it to mean no customs union, although that might not even be her personal preference. It is borrowed from Tory MPs who believe total autonomy, when striking future trade deals, is the supreme goal to which all other economic considerations – not disrupting existing trade, for example – are subordinate. That faction was incensed by reports that the prime minister was amenable to compromise. Following the usual pattern, Downing Street quickly nursed their distemper with reassurance that the old red lines are unmoved.

Rudd says online EU registration will be 'as easy as shopping at LK Bennett' Read more

This skirmish has flared up for two reasons. First, the Lords last week amended the Brexit withdrawal bill with a clause advocating a customs union. Then reports emerged of a demolition job by European commission negotiators on solutions offered by UK officials to the problem of maintaining an invisible border in Northern Ireland without a customs union. What Downing Street thought to be an ingenious technical workaround looked in Brussels about as feasible as deploying herds of unicorns to check rules of origin and stop smugglers.

May has been sent back to the drawing board with little time to spare. Meanwhile, MPs are sketching out the fall-back option. On Thursday the Commons will vote on a nonbinding resolution backing a customs union. There will then be a more consequential vote on the Lords’ amendment next month.

Q&A What is a customs union? Show Hide A customs union means that countries agree to apply no or very low tariffs to goods sold between them, and to collectively apply the same tariffs to imported goods from the rest of the world. International trade deals are then negotiated by the bloc as a whole. For the EU, this means deals are negotiated by by Brussels, although individual member state governments agree the mandate and approve the final deal. The EU has trade deals covering 69 countries, including Canada and South Korea, which the UK has been attempting to roll over into post-Brexit bilateral agreements. Proponents of an independent UK trade policy outside the EU customs union say Britain must forge its own deals if it is to take advantage of the world’s fastest-growing economies. However they have never explained why Germany manages to export more than three times the value in goods to China than Britain does, while also being in the EU customs union. Jennifer Rankin

This is all part of the longer struggle between May and parliament for control over Brexit. A crucial battle will be fought next week over another withdrawal bill amendment, introduced in the Lords with cross-party support, but brokered by Keir Starmer, the shadow Brexit secretary. The proposal addresses a scenario whereby May’s final Brexit package is rejected by parliament. As things stand, the default would be a tumble towards the exit with no deal. That proposition is too horrendous for most MPs to contemplate, which is why the government wants it to be the only alternative to its offer.

The amendment would weave a safety net, forcing ministers to take instruction from MPs on what to do next if May’s deal is defeated. How that would work in practice is mysterious but, in theory, it removes some of the jeopardy from the autumn showdown.

And May needs maximum jeopardy to impose discipline on her party. In particular, she needs the Tories to dread a sequence of events that somehow triggers a general election and propels Jeremy Corbyn into No 10. (There are Labour MPs who aren’t much less alarmed by that prospect.) This is partly why soft Brexiteers are seeding controversial amendments in the Lords. It is easier for Conservative MPs to vote for something handed down to them from the upper chamber than for something that their whips could decry as a frontbench Labour hit job on the prime minister.

Play Video 2:00 Emily Thornberry: It will be a 'blah, blah, blah' Brexit divorce – video

In an effort to ramp up the stakes, Downing Street hinted that votes on the customs union might be escalated to matters of confidence in the government, although it isn’t clear how that fits into the strictures of the Fixed-term Parliaments Act. The implied threat to put the government’s survival in the balance has receded but the underlying tension isn’t going away. The parliamentary timetable resembles a densely embroiled chess game. It is one of those brain-aching situations where multiple pieces are all threatening and protecting each other – pawns on knights on bishops on more pawns on rooks. No one in Westminster can see enough moves ahead to know where the advantage will lie in the endgame, after the frenzy of capture and counter-capture has thinned out the board.

May is no grandmaster. The customs union trap was not hard to spot. To the EU she promised an invisible Irish border, and to Tory backbenchers she pledged freedom to diverge from European regulation. Those two things contradict one another.

Customs union Q&A: what is it and can the UK manage without it? Read more

But May’s big blunder was earlier, when she became prime minister, in her Brexit-means-Brexit phase. She chose not to engage with the hidden complexities of a project made to look easy by the binary referendum question. She did not accept that there were ways to leave the EU other than the hardest, steepest path. She might have considered staying in the single market, the European Economic Area or the European Free Trade Association. Those are bona fide Brexits, but better calibrated to the 52:48 people’s ratio. Instead May was persuaded that democracy demanded a formula closer to 100:0. That is the least stable compound of all.

It wouldn’t have been easy to sell a 52:48 Brexit. Some leavers would feel it sullied the ideal of immaculate separation. Hardcore remainers would pine for full integration. But disappointment is built into any Brexit model because the technocratic grind of ending EU membership cannot satisfy the heroic promises of national renewal made by the leave campaign. And those Tories with an appetite for 100% pure Brexit are the least satiable people in politics. They gobble concessions and ask for more. May could storm out of Brussels tomorrow and they would complain that she hadn’t slammed the door hard enough.

May faced a choice between a fantasy Brexit, designed only to gratify a minority who are immune to gratification, and real Brexits that require compromise on every side. It wasn’t an appealing decision, but nor was it a hard one. Still she chose poorly. It wouldn’t be easy for her to change course now. But nor is it too late.

• Rafael Behr is a Guardian columnist