I suspect the Chinese leadership aren't that crazy, and if Taiwan had nukes, China would not invade.
China would invade well before Taiwan gets to the point of second strike capability and even a proper first strike.
Taiwan can be essentially evaporated in a first strike, there will be little to no advanced warning and unless they station their nukes off the island they will never be able to build a sufficient deterrence.
That is, yes, Chinese nation won't be obliterated; most people would survive. But the resulting chaos would be nothing like the country before that. It would be up for grabs for the strongest local groups, and whatever international / foreign forces which would inevitably come with humanitarian aid.
Most importantly, the powers that be can't hope to retain the control of the country, to say nothing of their own quality of life (and maybe the life itself).
This is why nuclear deterrence works.
Getting to one nuke sure maybe, getting to dozens warheads you claim are needed and the 100’s in reality that would be needed, a robust delivery system and a first and second strike capability... are you kidding me?
Nuclear deterrence works well with near peers, it doesn’t work when one side can’t take a single hit and the other can.
Nuclear deterrence won’t work at that scale it’s also why Israel is worried about an Iranian bomb.
Deterrence works when both sides are at least somewhat equal in size and population, China can take 100’s of nukes and still survive in some form or another you ain’t going to kill 1.5 billion people, Taiwan on the other hand is an island that can be taken out in a single strike.