I would say that it was never meant to work out in the first place.
The Turkish military isn't incompetent. They're an exceptionally well trained force. And they have institutional experience with multiple coups in the country's past.
When the Turkish military actually wants to overthrow a government, they know exactly how to do it. They do it swiftly. They shut down communication, they quietly arrest all members of the parliament and the cabinet before a General goes on TV to make the declaration. That's the way it's done without violence and bloodshed. Those of us old enough to remember the 80s will think back on Kenan Evren and remember that his coup successfully ended before anyone even found out there was a coup.
What happened tonight was not a coup. It was a sham. It was Erdogan realizing that he wasn't going to win a referendum for Presidency, and instead engineering an orchestrated fake coup attempt to garner sympathy, so that he can consolidate his power and entrench his dictatorial rule. We watched what little left of the Republic of Turkey die on live TV and social media broadcast tonight. Now we get to watch as Erdogan declares himself the new sultan of Turkey, and uses tonight's events as justification for imprisoning and executing anyone who dares to criticize him. Enjoy!