SOFIA, Bulgaria — As I was boarding a Turkish Airlines flight to Ankara some days ago, a flight attendant handed me a slickly produced brochure telling the story of the failed coup attempt of July 15. It praised the Turkish people and their spirited defense of democracy, and it blamed the Gulen movement that allegedly organized the coup, portraying it as the sort of dark religious conspiracy that you’d expect to find in a Dan Brown novel.

The patriotic brochure foreshadowed much of what I was to hear from government ministers, independent journalists and opposition leaders during my visit in the country. These very different individuals, often coming from opposite political camps, were in lock step on one thing: The July 15 coup attempt was completely unexpected (in a country that had endured four coups in recent decades), and for that reason deeply traumatic. And to a person, they blamed the Gulenists.

That sense of surprise helps to explain how an ill-managed coup that seemed to end as soon as it began could nevertheless send shock waves through the country. For a brief frightening moment, Turks confronted the possibility of being drawn into a bloody civil war. What’s more, the West responded with a combination of halfhearted condemnation of the coup plotters and a wait-and-see realpolitik.

But while Turks have reason to be angry with the Western reaction, Ankara’s official narrative suffers from its own tendentious blinders. It has blamed the malicious influence of the religious leader Fethullah Gulen, although support for the coup was much broader. To hear the ruling Justice and Development Party tell it, the Gulenists are to blame for the government’s crackdown on protesters in Gezi Park in Istanbul in 2013 and the shooting down of a Russian plane on the Turkish-Syrian border last fall. Some even accuse them of masterminding Turkey’s resistance to a joint American-Turkey military operation against the Islamic State in Syria.