Boris Johnson shut down parliament amid chaotic scenes in the early hours of Tuesday following his sixth parliamentary defeat in six days, as MPs voted to block a snap election and to force the publication of No 10’s secret preparations for a no-deal Brexit.

MPs on the opposition benches shouted: “Shame on you” at Conservative MPs as they filed out behind the Speaker, John Bercow, during the start of proceedings to prorogue parliament until 14 October, while others held up signs saying “silenced”. Renditions of Red Flag, Jerusalem, Flower of Scotland and Bread of Heaven were also sung.

Bercow told the Commons “this is not a standard or normal prorogation” and that the move represented “an act of executive fiat”. Opposition MPs tried to physically stop Bercow from leaving his chair to go to the House of Lords to finish the prorogation formalities.

Earlier, Johnson moved to stop parliament sitting for five weeks and repeatedly refused to countenance any delay to leaving the EU, even though the bill to prevent a no-deal Brexit on 31 October passed into law on Monday and MPs refused him a general election before that date.

Johnson was also defiant about parliament’s vote, by 311 to 302, for him to publish Operation Yellowhammer documents detailing the government’s no-deal Brexit plans, after a leaked version from early August warned of possible food and medicine shortages.

The motion, brought by former Tory MP Dominic Grieve, also directed Johnson to disclose messages relating to the suspension of parliament sent by his senior adviser, Dominic Cummings and various other aides on WhatsApp, Facebook, other social media and both their personal and professional phones. Grieve said he had information from public officials that such correspondence contained a “scandal”.

But Downing Street sources suggested Johnson’s advisers would resort to legal action rather than hand over their communications. Any refusal to comply could put them and the government in contempt of parliament.

Johnson’s options then narrowed further on Monday afternoon, as parliament’s bill to prevent a no-deal Brexit on 31 October received royal assent and passed into law.

He then launched his second attempt to get parliament to back a general election in order to get a mandate to leave the EU by 31 October, accusing Labour leader Jeremy Corbyn of “preposterous cowardice” for refusing to support one. However, Corbyn said Johnson could not be allowed to dictate the terms of an election before a no-deal Brexit was taken off the table.

Only 293 MPs voted to go to the polls, which did not meet the two-thirds threshold of MPs required under the Fixed-term Parliaments Act. The loss of the vote means there cannot now be an election until mid-November at the earliest, given parliament’s suspension.

In a further setback for No 10, John Bercow, the Speaker of the House of Commons, announced he would stand down on 31 October if there was no election before then. This means his immediate successor is likely to be chosen by the current parliament, in which there is no majority for a no-deal Brexit. It also confirms Bercow will still be in post during the crucial fortnight when parliament returns from prorogation in mid-October.

Bercow, who received a stream of tributes from Labour and other opposition MPs, has been instrumental in empowering backbenchers to hold the executive to account over its Brexit policy and to pass the legislation preventing the UK’s departure from the EU without a deal.

Play Video 2:58 MPs praise John Bercow for his service as Speaker – video

Minutes after announcing he would step down after 10 years, Bercow said he was allowing Grieve, a former attorney general, and Corbyn to move humble addresses putting Johnson under pressure. The device was previously used by MPs to make Theresa May publish the government’s legal advice on Brexit.

Corbyn’s address was designed to force Johnson to say he would abide by the rule of law, amid suggestions the prime minister could try to get around legislation mandating him to request a three-month delay to Brexit if there is no deal by 19 October.

Johnson’s official spokesman insisted on Monday that he would abide by the rule of law but, at the same time, the prime minister has said he would rather “die in a ditch” than ask for an extension to article 50. Johnson later told the Commons repeatedly: “I will not ask for another delay.”

Following the defeats, several Tory MPs said they believed Johnson was trying to find a way to bring back some of the 21 Conservatives from whom he removed the whip for defying his Brexit policy last week.

The aim of the Grieve motion was to prove that Johnson and his administration had misled MPs with their claim that the move to shut down parliament for five weeks was not to frustrate debate about Brexit. Grieve said he had asked for the information relating to prorogation because public officials had informed him that “they believed the handling of this matter smacked of scandal”.

However, senior government aides suggested No 10 would refuse to comply, potentially putting Johnson and senior members of his administration in contempt of parliament and creating a fresh clash between the executive and MPs.

Cummings has already been found in contempt of parliament once before after failing to appear before a select committee investigating fake news. One government source said the vote was “an abuse of parliamentary procedure and would never have been allowed under an impartial speaker”.

Play Video 1:41 Jeremy Corbyn tells Boris Johnson: 'This government is a disgrace' – video

“If MPs want to seize the private texts of advisers to their friends, families, colleagues and journalists then they can speak to people’s lawyers,” they said.

A Downing Street spokesman said the scope of information requested was “disproportionate and unprecedented”.

However, Bercow said the “government must comply with the humble address ... that is the reality”, even in a period of prorogation.

The government suspended sitting in the House of Commons and House of Lords until 14 October – a move condemned by opposition parties and anti-no-deal Tories.

Criticising the prorogation, Corbyn, said it was “disgraceful” and accused Johnson of wanting to run away from questions.