Invading Taiwan would be an act of desperation as success is far from guaranteed, and this coming from one with experience in amphibious assault operations and WARPAC and CHICOM weapon systems, strategy and doctrines. Not only would any success by a Phyric "victory', but casualties, in every way, could be horrendous - mililtarily, politically and economically.
As the war in Ukraine has shown, PGMs, modern intelligence, and PGM use, from standoff platforms and the cost-benefit ratio of modern missiles, both SAMs and tactical SS, MANPADs and ATGAMs, favour the defender. Logistics would be an absolute nightmare. Politically, the results of China's "Wolf Warrior" diplomacy, would be chicken feed, for want of a better term, compared with the approbrium, isolation and sanctions resulting from Russia's actions in Ukraine. And finally, above all else, China is an Importer of food all forms of energy and an exporter of manufactures to survive and while it has built up stocks of food and energy, they will be pretty ephemeral in the event of a blockade as would cash flows denial of access to export markets.
China is engaged in a massive and widely publicised arms build up, especially of its navy, but at present and near term future has very limited ability to project power and, more importantly, guarantee its mercantile marine transit to and from, say, the oil fields of the Middle East. The life of both its navy and mercantile marine would be both short and exciting.