For a reputed “strongman”, Recep Tayyip Erdoğan seems unusually nervous these days. A bombastic speech last week marking the third anniversary of a failed military putsch could not conceal his insecurity. He says he is using his sweeping powers as executive president to build a “new Turkey”. But it appears the old one is tiring of him fast.

“The 15th of July was an attempt to subject our nation to slavery,” Erdoğan declared. “But as much as we will never stop protecting our freedom and our future, those who lay traps for us will never cease their efforts.” It was a typical pitch, blending nationalism with scare stories of secret foes, foreign and domestic.

Erdoğan remains convinced his enemies are out to get him – and in the manner of all dictators, conflates his personal prospects with those of the state. The latest villains in this self-centred drama are the country’s American and European allies who, as he tells it, seek to subjugate both him and the proudly rising Turkish nation. But freedom is a fungible concept in Erdoğan’s Turkey. Tens of thousands of supposed plotters have been jailed pending trial since 2016. More than 100,000 public sector workers have been suspended or sacked. Another purge preceded the coup anniversary, with more than 200 military personnel and civilians accused of treason.

Particular concern is focused on Turkey’s justice system. Britain’s Law Society, citing the “widespread and systematic persecution of members of the legal profession”, has reported Turkey to the UN human rights council. Journalists have suffered similar intimidation. Most Turkish media now tamely toe the government line.

Erdoğan has good cause to worry – but the real reason may be simpler: he has made a dreadful hash of things. During 16 consecutive years in power, Turkey’s modern caliph has driven the economy into chronic debt, played regional power-broker with chaotic results, and scapegoated the Kurds for his failures. Now the bill is coming due.

Turkey remains in recession following last year’s calamitous currency crisis, amid fears a new financial crunch is imminent. Unemployment and inflation are high and business is slack. Erdoğan’s sacking last week of the central bank governor was seen as a sign he will persist with his discredited strategy of spurring growth with borrowed money.

For the first time in years, his political grip is threatened. Erdoğan’s ruling AKP suffered local election losses in five of the six largest cities in March. He was humiliated again last month in Istanbul’s re-run mayoral election. And his monopoly on power makes it harder to shift responsibility to others.

External affairs is another disaster area. Scoring a spectacular double last week, Erdoğan fell out with both the US and the EU in the space of a few days. In Washington’s case, the row was over Nato member Turkey’s decision to buy a Russian ground-to-air missile system. Some analysts suggest Erdoğan wanted to demonstrate Turkey’s independence. Others put it down to paranoia. He reportedly still suspects Washington of tacitly supporting the coup and protecting its US-based alleged leader, Fethullah Gülen.

Whatever his motives, the missile purchase led the US to cancel a sale of F-35 jets and threaten more sanctions. The cost to the Turkish defence industry, which would have made some aircraft components, is put at $9bn. Bigger still, potentially, is the cost to Nato. The foreign ministry in Ankara warned on Wednesday of “irreparable damage”.

Erdoğan’s always tense relations with the EU, strained by the Syrian refugee crisis, underwent a simultaneous rupture. After Ankara ignored Cypriot warnings not to drill for oil and gas in eastern Mediterranean waters that Nicosia claims as its own, EU foreign ministers imposed yet more sanctions.

The notoriously combative Erdoğan has fallen out with many regional neighbours over the years, including Syria, Egypt, Israel and Saudi Arabia, not to mention Greece. To break with the US and Europe in the same week is some achievement, even by his choleric standards. Yet Erdoğan supporters claim it’s part of a deliberate plan to boost Turkey’s independent standing in the world.

On this analysis, Erdoğan’s cosying up to Russia’s Vladimir Putin puts the US on notice that Turkey has strategic alternatives. It could help the economy, which needs Russian trade and tourism. And it suits Ankara’s policy in Syria where, despite being on opposite sides, Turkey has collaborated with Russia and Iran.

But this apparent tilt towards Moscow may yet prove another big miscalculation. Erdoğan says he wants to stay friends with the US and be part of Nato – but has sowed grave doubts about his dependability. Meanwhile, Russian and Syrian regime forces have begun an offensive against rebels and Islamists in Idlib, Aleppo and Hama provinces, in north-west Syria. The offensive contravenes a ceasefire agreed with Erdoğan last September that set up a demilitarised zone inside Syria overseen by Turkey. Its forces were attacked in two separate incidents in May. Fighting in Idlib has since intensified amid renewed civilian atrocities.

Russia and Syria aim to finally bring the civil war to an end by storming the last rebel areas. Erdoğan’s aim is to extend Turkish-controlled “safe areas” eastwards along the Turkey-Syria border in order to hold Kurdish “terrorists” at bay – and prevent another refugee exodus. These aims look increasingly incompatible.

At odds with the US, Europe, his Arab neighbours and potentially Russia, too, and increasingly unpopular at home, no-mates Erdoğan is treading a lonely, destructive path towards a strategic and political dead end. The looming question is whether he will take Turkey down with him.