The coup was probably fake, and was followed by a political purge across government.
Erdogan's staff violently attacked people in the US during his visit. Erdogan is supporting a radical religious takeover a secular state. He has a history of cancelling election when he doesn't like the result.
He rules in the style of Trump, ignoring the law.