Erdogan wants to take Turkey out of NATO (and pursue his caliphate or whatever) but he needs NATO to ditch him, and not the other way around.
That's why he's acting the way he's been acting - he wants to be kicked out.
If NATO ditches him it would immediately
serve as a great propaganda tool for the
upcoming caliphate.