JUNE's General Election result contained many surprises, but the shock on the faces of senior Scottish Labour figures was symbolic of the party’s low expectations.

Kezia Dugdale's colleagues feared the party could slump to fourth place behind the Lib Dems, but instead, as the weird night unfolded, it became clear Labour had gone from one seat to seven. “We thought it was a late April Fool,” said one insider.

Labour’s low-budget campaign – with the exception of Edinburgh South – meant nobody saw the result coming. Voter contacts were down from 2015 and party headquarters simply did not have the data to notice a late surge. Although it was a strong result on paper, many activists believe Dugdale got lucky and argue the result was down to UK leader Jeremy Corbyn’s left-wing populism, not her own efforts.

Last week’s analysis by the Campaign for Socialism (CfS) – a left-wing group inside Scottish Labour – is the clearest attack yet on the strategy Dugdale and her advisers pursued.

By opting for an anti-SNP campaign, in which opposition to a second referendum was a key plank, CfS believes Labour let the Tories off the hook and ended up boosting the Conservative vote.

Left-wingers insist a Corbynista campaign in Scotland, rather than a Unionist offering, would have led to the return of up to 15 MPs. However, while the CfS analysis may be correct to highlight an imbalance in the campaign, the report was also written with the benefit of 20/20 hindsight.

Scottish Labour’s General Election campaign was a blunt, but necessary, corrective to the mistakes Dugdale made since becoming leader in 2015.

In Scottish politics, unless a firm position is adopted on the constitutional question, voters are unlikely to give a political party a hearing on anything else. Dugdale, much to the chagrin of her natural supporters, famously said it was not “inconceivable” she could back independence and said her party’s MSPs would be free to campaign against party policy in a second referendum.

Her flip-flopping was a gift to the Tories and led to the migration of votes to Ruth Davidson at the Holyrood election.

As the General Election campaign loomed, Scottish Labour had come third behind the Tories in two elections and saw its opinion poll rating slump to 13 per cent.

Labour’s Unionist strategy in the Westminster contest was about stopping the floor from collapsing, stemming the losses to the Tories, and ensuring the re-election of Dugdale ally Ian Murray.

In the end, gains from the last-minute Corbyn bounce slightly outweighed further losses to Davidson and Labour’s vote increased to 27.1 per cent – up 2.8 per cent compared to 2015.

The CfS analysis will inevitably be framed as a warning shot against Dugdale, but the leader’s problems with her party run deeper.

Figures on the Scottish Labour right, particularly those who have a regard for Better Together, believe Dugdale’s sloppy words on the constitution let in Davidson, while some on the Left view her as a New Labour careerist.

The leader’s dilemma is clear. If she continues to prioritise the Union over a left-wing economic agenda, she will find it hard to woo soft Yes voters. Equally, by softening her language on the constitution, she risks losing more support to the Tories.

General Election gains normally shore up a leader’s position, but June's result has ended up exposing the frailties of someone unloved by both wings of her party.