Keir Starmer, the shadow Brexit secretary, was pushed to the brink of resignation early this year after Jeremy Corbyn and his allies tried to kick his customs union plan into the long grass, senior Labour sources have told the Guardian.

Labour’s Brexit policy has evolved over the past 18 months through a series of painstaking negotiations between key players at the top of the party, the most fraught of which came at a stormy meeting of the “Brexit subcommittee” early this year.

Corbyn’s close allies ambushed Starmer with a paper which shelved the decision on joining a customs union, a policy he had been pushing privately for weeks.

Several people present at the meeting told the Guardian the general feeling in the room was that Starmer was willing to resign rather than accept the proposals, numbered copies of which were handed out at the start of the meeting and retrieved at the end.

“He looked close to telling them to shove it – and I think that did count for something,” said one MP present. “I think Jeremy was slightly surprised at how angry Keir was, and how pissed off he was.”

Another witness to the confrontation said: “Jeremy started speaking, and Keir just said, enough, this was just completely outrageous. He did lose his temper. I think they were genuinely shocked at his reaction. They tried to bounce him and it completely backfired.”

Starmer and his backers on the Brexit subcommittee, including Labour’s leader in the Lords, Angela Smith, and Owen Smith, who was then shadow Northern Ireland secretary, argued a customs union was the only way to safeguard manufacturing supply chains and avoid a hard border in Northern Ireland.

But members of Corbyn’s inner shadow cabinet, which includes Jon Trickett and Diane Abbott, were anxious about appearing to cave in to noisy backbench advocates of a customs union – such as Chuka Umunna and Chris Leslie.

They were also keen to ensure any stance the party ultimately took could reconcile the Brexit leavers and remainers.

So they drafted their own paper, in a move that foreshadowed Theresa May’s attempt to bounce her Brexit secretary, David Davis, at Chequers, by surprising him with a handout that he, at that stage, had not seen.

Within weeks Starmer’s proposal that Labour should sign up to the idea of a customs union – while insisting Britain retained the right to strike its own trade deals – was adopted. But Labour stopped short of advocating joining the single market.

A Labour source insisted the paper had concerned only the party’s communications strategy. The source added that Starmer’s team had subsequently worked closely with Corbyn’s office.

A source close to Starmer admitted that the meeting had been robust but insisted that he had not been close to resignation.

But the face-off between the politicians underlines the tension that has hampered Labour’s progress through the political minefield of Brexit.

Details of the clash emerged as the party confronts another critical moment in the evolution of its Brexit policy, with hundreds of delegates at Labour’s conference in Liverpool, which starts at the weekend, planning to force the issue of a second referendum.

Labour strategists are sceptical about the idea of a new EU referendum, fearing it would risk alienating leave voters and could play into Theresa May’s hands, by giving hardline Tory rebels a reason not to vote down her deal.

“The only way that her deal is going to get voted down, is if some of the European Research Group vote against it – and they’re not voting against it if they believe one of the options then is a second referendum. The surefire way to get the ERG to vote with the government is to talk about a second referendum,” said a senior Labour figure.

Meanwhile, the People’s Vote campaign has published a “roadmap” to a referendum, produced by a panel including Conservative MP Dominic Grieve and Labour’s Chris Leslie.

It suggests the UK could unilaterally revoke the article 50 letter sent by Theresa May last year to kick off the Brexit process; and that MPs could seek to amend the parliamentary motion approving the government’s Brexit deal, to insist on a referendum.

“MPs could amend the motion put forward by the government if/when it presents its deal to parliament. The vote on this motion is expected to take place shortly after agreement has been reached with the EU. An amendment from the opposition, Conservative backbenchers or cross-party (if allowed by the Speaker) could require that the deal be subject to a ’people’s vote’,” the analysis claims.

• A special report on Labour’s Brexit policy will be published on Wednesday morning