The Chinese military drive the tanks, not the CCP leadership.
The Chinese military is not a separate military in the way we think of it in the West. They are the armed wing of the Chinese communist party. An enormous amount of time is spent on political indoctrination; not just when joining the PLA, but continuing throughout one's time in the PLA. Senior military commanders are senior party members. The PLA does not stand for the the Chinese constitution or the Chinese people, but for the CCP, of which they are an integral part.
I'm not saying it's impossible, but it wouldn't be a military coup; it would be the CCP splitting and turning on itself.