Labour’s so-called Red Wall, the string of devout and entrenched seats stretching from North Wales to Northumberland, proved as resilient as the polystyrene one Boris Johnson drove a JCB through in a pre-poll publicity stunt. The supposedly irremovable bricks in Workington, Bishop Auckland, Darlington – even Tony Blair’s old Sedgefield constituency – tumbled.

The scattergun of Labour’s election policies, while generally approved of if doubted on their fiscal provenance, proved ineffectual against the stark and simple Tory message of “Get Brexit Done”.

Labour, it seemed, had learned nothing and forgotten everything. But it was the prevarication and the switching of positions on Brexit to try to suit all which did it.

In June 2016, immediately after the vote to leave the EU, Labour leader Jeremy Corbyn had pledged: “We must respect that result and Article 50 has to be invoked now so that we negotiate an exit from the EU.”

But then the party swithered and dithered for the best part of three years before coming out with a hopeless, morphed fudge that a Labour government would renegotiate with the EU and put that to the British people.

In 1992, in Bill Clinton’s successful US presidential campaign, the Democratic strategist James Carville coined the slogan for party workers to keep them focused on the main message: “The economy, stupid.”

This is a lesson Labour ignored, while for the Tories their main strategist Isaac Levido came up with the winning one, “Get Brexit done”. The 36-year-old Australian was serenaded by Tory party workers as the TV exit poll predicted a landslide, singing, in a rip-off of Corbyn’s chorus, “Oh Isaac Levido”.

If we believe the final polls – and this time, unlike in 2017, they were accurate – then 69% of Leave voters voted Conservative, a nine-point increase on the previous election, while for Labour there was no good news on either Remain or Leave voters – the former were at 48% support, down five points, and at just 26%, some nine points down, among Leave voters.

This was reflected in Thursday’s vote. The Tory share of the vote rose by six points in seats where more than 60% had voted Leave, whereas Labour’s fell by 11 points in the most pro-Leave seats.

Labour’s result, with 203 seats, is their worst in the post-war period, and somewhat redeems Michael Foot’s 1983 debacle – the manifesto then called the so-called longest suicide note in history – of 209 seats. In 1983, the Economist wrote that to find a typical Labour seat one had to look at impoverished inner cites and broken-down towns, but it is just those places, still largely in the same state of disrepair, which have flocked to the Tories in this one. Today that typical Labour bastion would be fervently pro-European, highly-educated mainly in the prosperous south of England in a university town or city.

The working class, if there still is such a group, has deserted Labour for the Tories in England and the SNP in Scotland. This meltdown has been decades in the cooking. Labour grew from social institutions, most of them centred around the workplace. However, the traditional heavy industries have gone – shipbuilding, mining, steel – and with them Labourism, the shop stewards, the unions, local organisations. Just about every institution which fostered working-class solidarity has been bulldozed like the Red Wall. In its place have come zero-hours contracts, austerity, child poverty, factories replaced by call centres, fancy memorials put up over holes in the ground where men used to go to work.

There was meant to be a transformation of the old into a new, skills-based economy – that’s what Labour’s Tony Blair government promised. Tell that to the voters of Blyth Valley, which has been Labour since the seat was created in 1950, and was the first shock Tory victory of 2019.

Instead of local candidates, who would often come from a union background, contemporary New Labour parachuted in its chosen people to plum seats, parliamentary aides, union bureaucrats, would-be careerist politicians, while its traditional base was marginalised and ravaged economically.

Corbyn became the accidental Labour leader – he only got on the parliamentary party vote because several of his colleagues lent their votes, not wanting to see him humiliated in the ballot. It was the membership which supported him overwhelmingly, not once but twice.

He, of course, has never been accepted by his parliamentary colleagues – he lost a vote of confidence by his MPs 170 votes to 40 in the summer of 2016 – and for most of his tenure, in what may be unprecedented in contemporary UK politics, they openly disparaged him.

It became a blatant coup attempt, triggered by the sacking of shadow foreign secretary Hilary Benn who told Corbyn that he had lost confidence in his leadership. This triggered a mass exodus from the shadow cabinet but, unlike Boris Johnson’s dealing with rebels, the whip was not withdrawn from them and they continued to seethe and plot against him.

But the one issue to dog Corbyn was the accusation of institutional anti-Semitism in the party. Margaret Hodge went further and accused him of being a racist and anti-Semite, which baffled anyone who knew him or had followed his parliamentary career.

An inquiry set up by Corbyn and chaired by Shami Chakrabarti concluded that the party was not overrun by racists, but the report was widely criticised for its softly-softly approach and the issue continued to run right through to the election, with the Chief Rabbi Ephraim Mirvis resuscitating it almost on the eve of poll.

The right-wing press also carried out a relentless vilification of Corbyn, from anti-Semitism to accusing him of having terrorist sympathies and being a security threat, to being an anti-royalist and republican because he said he watched the Queen’s Christmas message in the morning, when it is actually in the afternoon. Corbyn’s predecessor, Ed Miliband, had been mocked over his eating of a bacon sandwich, his brother David, and rival for the party leadership, had been pilloried for the way he held a banana, but the war on Corbyn was relentless and unprecedented.

One of the lessons Labour should have learned, apart from the right way to grasp fruit, the most prescient one, was to look beyond the Red Wall and Hadrian’s Wall to Scotland, and how the formerly hegemonic party had collapsed in the country.

Arrogance in power, failing to respond to the needs of its base communities, had provoked the backlash, and a switch not to the Tories, but to the Scottish National Party and around independence rather than Brexit.

Labour’s shadow chancellor, John McDonnell, conceded that in some of the party’s banker seats, “a long history of maybe 40 years of neglect” had seen them fall. In 1983, the SNP held two seats in Scotland. Now they have 48, the majority, overwhelmingly, in what were once considered safe Labour seats.

The revival may have started in the Highlands but it spread quickly to the central belt and urban areas, to the poor and deprived who were once Labour’s backbone.

Now, just one MP remains, Ian Murray in Edinburgh South, a relatively prosperous constituency. Murray has been an outspoken opponent of Corbyn and described his leader as “toxic on the doorsteps”, a view that was widely held in the seats in England the party lost.

This was, like it or not, a vote about nationalism. In Northern Ireland there was a nationalist majority, as there was in Scotland, and in England – despite the overall vote apparently splitting 52% to 48% for Remain parties – in the ones that counted, the marginals, the former Red Wall, it was overwhelmingly the case.

Labour’s failure was to ignore the evidence on the ground, to confront English nationalism, and by attempting to appease its parliamentary Remainers, betraying the verdict of the electorate and its core support.

Corbyn’s failures were manifold. He may have been unfairly pilloried but he lacked clear and decisive leadership, epitomised by saying he would remain neutral in a forthcoming ballot on Brexit, leaving the rest of the country to mock him over what wasn’t just unlikely, but a vanished possibility.