Politicians will move heaven and earth to prevent the country leaving the EU with no deal, John McDonnell has said, adding that such an outcome would be catastrophic for the economy.

Speaking before an event in Gravesend, Kent, the shadow chancellor also indicated that Labour might support a compromise proposed by two of the party’s MPs which would see Theresa May’s withdrawal agreement put to a public vote after being passed in the House of Commons.

McDonnell criticised the prime minister’s parliamentary tactics this week, particularly her emphasis on the legal default of the UK leaving without a deal on 29 March.

“I think that’s irritated MPs so much, that’s why no deal was voted out, and I know that was only an advisory motion but I think MPs would move heaven and earth to prevent no deal if she tried that again,” he said.

“People have looked over the edge, they’ve taken the advice of Theresa May’s own Treasury department, they’ve taken the advice of the Bank of England, every independent assessment of the consequence of no deal, which is pretty catastrophic for our economy.”

He confirmed the party leadership would back the amendment giving the UK the final say on any deal that is eventually passed by parliament.

“We are working with Peter Kyle and Phil Wilson, they have their amendment, which was about going back to the people with whatever was agreed in parliament,” he said. “So we’ve said we would support that if it comes back, and it may well be this week but it will be down to the tactics they want to pursue, because they will only push that when they think they’ve got a realistic prospect of winning.”

McDonnell cautioned against accepting the current withdrawal agreement, saying that it wasn’t credible and would cause economic harm.

“There’s no point putting Theresa May’s deal or something like that, in my view because it’s not credible, it’s dangerous. It has to be a credible deal that we think would protect jobs and the economy, and I think that’s what a majority of MPs would vote for. I don’t think a majority would vote for something that would damage their constituents’ livelihoods.”

A referendum on whatever deal emerges could take place in a “relatively curtailed period of time”, he said, although the Electoral Commission has said that it could take months to organise the campaign and the vote.

Whatever deal is agreed would have to be realistic enough to convince the EU that delaying the UK’s exit from it was acceptable, McDonnell said.

Labour whipped its MPs to abstain on Thursday from a Commons vote that would have supported a second referendum, despite it being party policy. Twenty-five MPs defied the whip to vote in favour of the motion and 18 voted against it.