Erdogan knows exactly what he’s doing. It certainly was no feat of incompetence that he took over enough of the military to stop him from being removed for being too Islamic.
While what you say may be largely true.
but..... Turkey is bankrupt and teetering on the edge of national economic failure. That teetering is the result of Erdogan absolute and total incompetence
So long as he holds the reins, the doom of Turkey is a sure thing.