Of the many weird aspects of the Tory campaign, one of the weirdest is the way in which Theresa May and her advisors conspired to create the impression that she is a mean person leading a nasty party.

The phrase “nasty party” was associated with May in an earlier incarnation when she warned that the Tories in opposition had to change and move away from that image. Back then she was Tory party chair, and her remarks annoyed many traditional Tories while encouraging the modernisers to push on.

You would think, with that being the case, that she would spot the danger in appearing to have revived the “nasty party” image and trashed her own brand in the process. For some reason – advisor hubris, personal failure of judgment, a tack rightwards towards UKIP voters or campaign inexperience – that is precisely what she allowed to happen. Despite having worked hard to associate herself with a different agenda, resisting the Americans over the Gary McKinnon case and fighting modern slave trading and people trafficking, May walked right into several traps. By the end of the campaign large numbers of voters – women especially – regarded her as Cruella de Ville.

The scrapping of school lunches and their replacement with breakfast might have some rationale, yet it looked faintly Dickensian. Please sir, can I have some rice krispies? No! We can’t afford it. Back to your seat.

Social care was supposed to be a progressive policy and in SW1 think tank terms it was. But the moment people hear – or mishear – that the government if re-elected would set about stealing the houses of old people with dementia, well, then you’ve lost them and their children and they won’t like the person who suggested it.

Meanwhile, Jeremy Corbyn – advocate of the IRA, supporter of Marxist maniacs such as Hugo Chavez and friend of homophobic Hamas loons – was travelling the country looking nice and genial and offering endless free stuff. May looked robotic in comparison, of course. But she also looked mean-spirited and lacking in empathy or generosity. May is not that, but it is too late once voters start thinking you are.

With hindsight – what a tremendous privilege that is – the first warning of the vast reputational damage being done came with the infamous (up in Scotland, anyway) “rape clause” which set new restrictions on benefits and a terrible test for those wanting to claim for a third child. They would have to prove the third child was the result of a rape. In Scotland the Nationalists tried, and failed, to use this to halt the rise of Ruth Davidson, who stood by the UK policy but looked uncomfortable doing so. The row faded but the impression left was vexing. Why had May simply not said the following? This is ridiculous, we can’t have a barbaric policy such as this which doesn’t save much money anyway. Ruth is right and we’ll reconsider.

In one of the worst crashes on record, May went from looking Strong and Stable to Narrow and Nasty in public perceptions in the space of a month. In the aftermath and with the government in a mess all manner of criticism is raining down on her head, some of it unpleasant and bordering on the downright misogynistic.

The idea in such circumstances that May is trying to “cling to power” is obvious nonsense. Why would she? The Prime Minister would clearly rather walk away and disappear. Although she has been in the business long enough to know that it is over, she also knows she has a duty, as she made clear in her pitch to the 1922 committee.

There has been a fashion in recent years for leading Tories choosing to walk away when it all goes wrong. David Cameron quit the morning after the 2016 referendum. George Osborne tried to stay (and was treated poorly by his rival Mrs May) but then left parliament. For all the fun he is having now, he must wish he had done it all a little differently and stayed. With a Commons seat he could be Prime Minister tonight.

He is not. And someone has to be. That someone is Theresa May, opting to stay out of duty during a deeply difficult period following her disastrous election campaign. None of it is likely to be sustainable beyond the short term, but even so the Tory leader deserves praise for staying where she is. It is an act of patriotism.

It is not immediately obvious that the country is in the mood for the further destabilisation of a Conservative leadership contest. There is not a demand in the country for a Stalinist government, sorry Corbynite Labour government, either because that party got only 265 seats.

So, she stays, with Tory MPs terrified of another election. What a turnaround on a month ago.