If governments are looking at Chinese-Taiwan relations, and gaming the result of an occupied Taiwan, those supply chains become profitable pretty damn quickly.
If China took Taiwan, they would be selling to the rest of the world most likely. However, perhaps they are planning for a case where the US bombed the crown jewels to maintain supremacy. That would create profits for a domestic sector.
The USG is perfectly happy to spend taxpayer money and foreigners' money to make their corporate constituency happy even if the financial equation is overall negative.
I don't think that there is any plausible scenario where China takes Taiwan chip fabs intact - if they are not disrupted during the conflict, I strongly presume they would all be intentionally blown up as soon as invading forces get a beachhead.
The USG is perfectly happy to spend taxpayer money and foreigners' money to make their corporate constituency happy even if the financial equation is overall negative.