For about a year, some openly suspected Erdogan frustrated the US enough for them to foment a coup. The US gov't loudly signaled its displeasure: "Early on, Obama saw Recep Tayyip Erdoğan, the president of Turkey, as the sort of moderate Muslim leader who would bridge the divide between East and West—but Obama now considers him a failure and an authoritarian, one who refuses to use his enormous army to bring stability to Syria." (http://www.theatlantic.com/magazine/archive/2016/04/the-obam...)
(I haven't yet seen any evidence regarding the US's role is in this coup, if any. I just mention this as a prominent example of how much he frustrates even his allies, so it's natural for many to go to the trouble of replacing him, despite all the risks.)