IIUC, he was not even in the country at the time the attempt was staged.
But I read somewhere they bombed his room at the hotel where he was staying and missed him.
Get a clue.
When the coup happened, Erdogan was vacationing in Marmaris, which is on Turkey's Mediterranean coast.
The story is, Erdogan high-tailed it to Dalman, where his Gulfstream IV was waiting, hopped aboard, and flew to Istanbul to go on TV and reassure his supporters.
There are reports the coup plotters tried to capture him in Marmaris, but were too late, and intercepted his airplane with F-16s but wimped out on pulling the trigger.
In any event, after some circling, he landed at Ataturk, greeted his supporters, and went on TV to denounce the plot and take command.
That's the story. But you have to wonder ... why didn't they take him out in Marmaris? Why weren't they waiting at Dalman? Why didn't they blow his Gulfstream out of the night sky?
Were they incompetent? Or were they in on it?