It's been an excellent bet for centuries, if you understand that to them, staying in power and subjugating the masses, is the definition of "rational action."
I'd argue that the technological changes of last couple of decades have dramatically changed their ability to have a hold on the population (and the population's access to uncensored information). It's not the same situation as it was for many of those centuries.
They're riding an edge in that they have to keep showing economic progress to those masses. They have to make the populace trust that while they might not have social freedoms, the government is actually making things better.
Zero-COVID put a huge dent in that trust. They're reeling. If our semiconductor export restrictions crater their economic growth, then they lose that trust even further.
So they're backed into a corner. At that point, what do they do? Modernize? Liberalize? Admit they've been wrong? Nah...
They turn around and blame an external actor (America, for our export restrictions) and convince your populace that bringing Taiwan, which you consider your rightful property anyway, back into the fold is a good idea to restore China's greatness and access to critical technology. And you make yourself believe that America or Taiwan will NEVER sabotage TSMC because all we care about is money and we won't shoot ourselves in the foot either.
The biggest question, IMHO, is whether they think they're powerful enough to pull it off.