"Maybe they can reduce Taiwan to a charred ruin and kill millions of people but what do they gain from that and at what cost?"
they get back Taiwan - it's an absolute fixation, devoid of any hope of common sense or value. Quite a few wars have started on for similar reasons
I take your excellent point that once they start the situation is out of their control - far from believing Xi is a megalomaniac I think he'll be very wary of losing control. THE only thing more important to the CPC is continued control by the Party. ALL that is on the table in a conflict. They know their history - it's not all "foreign interference" - there's a big chunk of "warlord-ism" not that long ago. No point in regaining Taiwan and having the PLA running the country.