If Ed Balls didn’t have the medium of dance through which to express his feelings, he might be forgiven for wanting to punch a wall right now. So perhaps we can expect a more than usually vigorous turn from the former shadow chancellor on this week’s Strictly Come Dancing. Imagine the frustration of losing a seat last May, only for some of your political thinking to live on, also in May. Theresa May, that is.

This has been a depressing, frightening week in UK politics; a time when genuinely ugly things have been said, then half-unsaid, but not forgotten. But it’s the worst possible time for progressives to abandon hope. May has not lurched right, or left, or towards the centre ground. She’s done all three.

She’s moved left into the kind of borrow-and-build, state-led economic strategy that Balls would recognise, and into an anti-fat cat rhetoric Ed Miliband absolutely did recognise, judging by his single sardonic tweet in response to hints of a clampdown on energy prices: “Marxist, anti-business interventionism imho [in my humble opinion]”.

But she’s also moved sharply rightwards on immigration, something Labour agonised over in the last parliament but couldn’t bring itself to do, even though it was clearly what many working-class voters wanted.

And all the time she’s talking of what she calls the “new centre ground”, although centre of gravity is perhaps closer to the mark; not some balanced ideological midpoint between left and right, but the great confusing expanse of political territory where those labels stop making sense, because public opinion seems to be left-ish on some things (believing big business must be screwing them over) but right-ish on social issues. And if that looks confusing and contradictory from the outside, imagine how it feels on the inside.

This week has revealed a government still interestingly unsure of its ground

May was right to point out this week how many politicians and journalists were wrong about Brexit. But her attack on the dreaded leftie liberal elite disguises the fact that they certainly weren’t alone in getting it wrong. Plenty of outers didn’t see victory coming either, judging by private conversations in the run-up to the referendum, and nor did many of May’s current cabinet.

Not long ago the health secretary, Jeremy Hunt, was earnestly telling us how Brexit would hurt the NHS, and Amber Rudd was socking it to leavers in the TV debate. What a difference a referendum makes. This week Hunt, an instinctive internationalist whose wife is Chinese, was trumpeting plans to train more British-born doctors instead of importing them – prompting a furious row over whether foreign doctors are being tacitly encouraged to leave.

Rudd, a socially liberal ex-journalist, meanwhile suggested companies be forced to publish data about how many foreign staff they employ. In a country happily relaxed about immigration, that might have sounded more pointless than sinister. In the current climate, she was accused of being one step away from handing out yellow stars.

And yes, it’s scary stuff. But it also falls apart surprisingly quickly when prodded, and therein lies the ray of hope: this isn’t a cabinet of racists. It’s a cabinet peppered with people terrified of being exposed as closet liberal elitists, clumsily second-guessing what people they’d once have regarded as racists think, only without the instinctive feel that true believers often have for when they’re going too far. Push back hard enough, and they give surprisingly fast.

Within hours, May was clarifying that she didn’t actually want to send any foreign-born doctors back, while Rudd was on radio explaining that her plan wasn’t necessarily going to happen – and the odds, given the instant backlash from business, are certainly against it. (When ministers asked firms to publish minimal and anonymised data about male and female salaries as part of its equality strategy, the furious complaints about red tape and unfair bad publicity nearly killed the plan. If they’re that afraid of a little light feminist critique, imagine how chief executives feel about ending up on some far-right hit list of supposedly “unpatriotic” businesses reliant on Romanians.)

If Rudd wants to see how divisive this idea might prove in the workplace, meanwhile, she could simply look down the cabinet table. Boris Johnson was born in New York, lived there until he was five, and until last year held dual American and British passports. Should May have hired a homegrown foreign secretary? Or should we be embarrassed to live in the sort of country where anyone would raise that question?

The damage is done now, of course. Some people will have heard the dog whistle all right, but missed the dogs being called off later. Sadly, those who have felt unwelcome here since June may simply feel more so. But the whole episode reveals a government still interestingly unsure of its ground, precisely because much of this isn’t naturally its ground; it’s still feeling its way in circumstances most ministers didn’t anticipate.

We are witnessing nothing less than a Tory reformation | Rafael Behr Read more

That means it can be shamed, it can be reasoned with, and now its defences have been tested properly its weak spots are more obvious – as are the places where arrows ping helplessly off its armour. And Labour ought to know, because it’s been there.

There was more than a whiff of Blue Labour – the economically leftwing, socially rightwing, heavily nostalgic movement that was fashionable for a while under Ed Miliband – about May’s agenda this week, and that provides some interesting clues as to where it might get unstuck. Team Miliband liked Blue Labour’s ideas on economic justice but balked at their awkward, uncomfortable messages on immigration (with the arguable exception of Balls, who was raising concerns over freedom of movement back in 2010).

Judging by the wild applause for every mention of Brexit in Birmingham, and the silence when May promised to protect workers’ rights, Red Toryism has a similar problem in reverse. But if the 2015 election result is anything to go by, cherrypicking the easy bits and ignoring the harder ones doesn’t work; like trying to dance a waltz without a partner, people can see something’s missing.

Trying to keep both ideologically warring halves of the package together, however, is like trying to waltz with someone who’s trying to make you dance the Charleston. Blue Labour excelled at capturing what angry voters thought, but could never quite turn it into coherent policy. Judging by last week, the Red Tories are about to find out how that feels.