In an interview on the BBC’s Sunday Politics Scotland in March, Mr Leonard said if Labour took power in Westminster the party would refuse to grant a “Section 30 order” giving Holyrood the power to hold another vote.

Mr Leonard added: “What we said in the manifesto at the 2017 election was that there is no case for, and we would not support, a second independence referendum.”

However, Mr McDonnell said on Tuesday: “The Scottish Parliament will come to a considered view on that and they will submit that to the Government and the English Parliament itself.

“If the Scottish people decide they want a referendum, that’s for them.”

On Brexit, Mr McDonnell said Labour leader Jeremy Corbyn would “never” step down if other opposition parties demanded it to form a coalition of national unity.

He said: “It won’t happen. I think we’d form a minority government, seek to implement our manifesto and we’d expect the other opposition parties and other MPs to vote for those policies and if they don’t, we’ll go back to the country.

“If they want to vote against a real living wage, if they want to vote against £70 billion worth of investment in Scottish infrastructure, if they want to vote against a green industrial revolution to tackle climate change then so be it, we’ll go back to the people and then let them explain to the people why they wouldn’t support those policies.

“We want to change the world, we’re not going to be held back by other parties.”

Later, the shadow chancellor ruled out standing to be Labour leader in the future and said he would like a woman MP to succeed Mr Corbyn.

He added: “I’ve tried to run for Labour leader twice and I was so popular I didn’t even get on the ballot.”

“They are committed to transforming the world, they are not career politicians,” he said.

Asked about Jess Phillips, the Birmingham MP who is seen as critical of Mr Corbyn, Mr McDonnell said: “I like Jess, I like her a lot.

“I think she’s got a lot of talent, I just wish she would be a little more praising of Jeremy.”

Mr McDonnell has strong concerns about Boris Johnson as Prime Minister, who famously said he would lie down in front of bulldozers to stop a third runway being built at Heathrow (Steve Parsons/PA)

The senior Labour frontbencher said he was “extremely worried” about new Prime Minister Boris Johnson.

He added: “I think he’s reckless and I think he’s unstable and I will move heaven and earth to stop a no-deal Brexit.”

One area he has previously agreed with Mr Johnson on is in his opposition to Heathrow expansion.

Mr McDonnell said he was still opposed to a new runway, both as a local MP and in light of the “climate emergency”, and he criticised Mr Johnson for being absent from a Commons vote in June 2018 on Heathrow expansion.

Mr Johnson was on a trip to Afghanistan in his capacity as the then foreign secretary at the time of the vote.

As London mayor, Mr Johnson said he would “lay down in front of bulldozers” to stop the building of a third runway at Heathrow.

He said: “These are utterly irresponsible comments from John McDonnell that betray our party’s values.

“The Labour Party is an internationalist party founded on a vision of solidarity and we should never seek to appease nationalists, whether they be for Brexit or Scottish independence, who want to divide communities and people.”