When Jeremy Corbyn wins the Labour leadership contest later this month, party members will inevitably face heavy criticism for re-electing a leader who is so deeply unpopular with the public.

But rather than continuing to label Corbyn's supporters as delusional cult-like entryists, his critics in the parliamentary Labour party would do better to examine their own failings to convince party members that its time for a change.

A large share of the blame for the result will understandably fall on Corbyn's rival. Owen Smith was undoubtedly a poor choice of candidate who few Labour members had even heard of before he announced his campaign. When I first heard that Smith was being trailed as the likely candidate to take on Corbyn, I was told that his status as an unknown 'clean skin' would be a big advantage in selling him to members. But while Smith may not have had anywhere near as much baggage as some other more prominent Corbynsceptic MPs, he had enough. His previous employment as a pharmaceutical lobbyist and PR man should have immediately rung alarm bells among his backers. At a time when the Labour party is further to the left than it has been for generations, a former big pharma lobbyist was always going to be a hard sell. In many ways the fact that he was so unknown in the party actually made it much easier for Corbyn's campaign to define him. When you're a "clean skin" any mud thrown at you becomes much easier to spot.

Another big problem for Smith's candidacy was the fact that it was unclear why exactly he was standing against Corbyn in the first place. Wary of being labeled a "Blairite," Smith decided to run on a largely identical platform to his party leader. By doing so, Smith hoped to pose as a 'more electable' version of his party leader. In many ways this was a logical strategy. Both Corbyn and Labour's poll ratings remain dire. If Smith could have convinced members he had a much better chance of getting Corbyn's agenda into government than Corbyn himself, he could have been onto a winner. But the strategy fell down on two fronts. First of all, it wasn't believable. There was little in Smith's past, either in politics or outside, that suggested he shared Corbyn's view of the world. When his opponent's main appeal to party members is his 'authenticity,' Smith's attempts to mimic those traits was never going to be convincing. Sure enough, the one poll of members we've had during this campaign confirms that. Asked to pick traits associated with the two men, the most popular choice for Corbyn among the party selectorate was "principled." The most popular choice for Smith was "untrustworthy".

The second reason this strategy failed was the fact that it wasn't obvious to members that Smith was actually significantly more electable than the incumbent. Memes showing the huge difference in turnout between Corbyn and Smith rallies, were highly effective in the early stages of the campaign at throwing doubt on Smith's potential popularity. Of course this was highly unfair. As recent council by-election results have shown, there is no relation between the size of a politician's rallies and their parties' performance in elections. Polls also show that Smith is more popular than Corbyn among the general public (although it's more accurate to say 'less unpopular').

But the memes, which spread widely among party members on Facebook, were effective at making Smith's campaign appear like a lost cause even before it had got started. The constant stream of local party nominations – 84% of which went to Corbyn – only confirmed this impression.

The other reason why Smith's electability argument failed to take off was the fact that he often appeared to be even more gaffe-prone than his rival. His comments about wanting to "smash Theresa May back on her heels" along with a string of other comments about women in the past, made it very hard for Smith to pose as the more electable and competent candidate. In some ways his reaction to such allegations were just as damaging as the allegations themselves. When I asked him at a press conference last week whether he regretted his 'gobstopper' comments about Nicola Sturgeon, he described them as just being 'banter' – a word which will have flashed warning lights for many Labour supporters. His defence of the wider allegations of sexism was equally bad – telling me that he couldn't be sexist because lots of women worked for his campaign. It wasn't quite as bad as Mitt Romney's comments about having "binders full of women" but it was close enough.

But it has been Smith's wider policy agenda that has most clearly highlighted the flaw in Smith's electability argument. His statement during last week's BBC Question Time debate that he would essentially ignore the result of the EU referendum was met with disbelief, even by Europhile members of the audience. His subsequent comments over the weekend suggesting that he would consider joining the Euro and Schengen free movement area, were similarly ill-advised. When Smith's biggest selling point is his supposed electability, it seems crazy to emphasise policies where he is actually much further out of touch with the public than his rival.

When Corbyn wins later this month, Smith will inevitably shoulder much of the blame. But this seems to me to be deeply unfair. Whatever his failings, Smith at least had the courage to put himself forward for what has been a hugely bitter and protracted battle. Where were the other Labour MPs who were willing to do the same? After all, just weeks before the campaign began, 80% of all Labour MPs backed a vote of no confidence in their leader. With the honourable exception of Angela Eagle, not one of those 172 MPs were brave enough to put themselves forward. Surely there must have been at least one other MP who would have been capable of at least giving Corbyn a run for his money. The fact that they didn't even try is a bigger indictment of Corbyn's parliamentary opponents than anything Smith himself did during this campaign.

Labour MP's own role in the failed coup against Corbyn will be a significant factor in the scale of his victory. While many Labour members may have had doubts about their current leader, the mass resignations from the shadow front bench created a situation in which any subsequent leadership election would always be seen as a proxy battle between party members and MPs, with Corbyn representing the former. The attempts by Labour HQ to exclude newer members from voting only played into that narrative.

Labour is in a worse state than it has ever been in my lifetime. At a time when the country desperately needs a decent opposition, the party is stuck in an apparently endless row with itself. The future existence of Labour as a viable governing party now remains in the balance.

When Corbyn wins, much of the blame will inevitably fall on the party's members for backing a man who has such little chance of ever becoming prime minister. But before Labour MPs lash out at their 'delusional' and 'cultist' members, they should first examine their own role in the calamity that now faces their party.