I don't agree. They could buy air defense systems, coastal ASMs, fighter jets for that. An SPG would disrupt a landing at best before getting blown up. If China is landing, it means Taiwan lost the air a few days ago.
SPG is useful before the landing, during the attempt to contain/destroy the beachhead(s), and in follow-up fighting afterward. If everything went that far, and they're still somehow around - howitzers are useful in ambushes and/or in city fights in a direct fire role.
SPGs, among other long-ranged assets, ensure the utility of minefields. Unlike many others - SPGs won't really be countered by EW and AA umbrella, and can be annoying even through smokescreens; the only means of silencing them is suppression/destruction. Which they're designed to evade.
SPG, as the most survivable form of heavy artillery, are a pain in the (***) just because they exist somewhere: they're one of the factors informing deployment points(how far out in the sea are they). You don't want to float your landing craft/amphibs and form attack waves under sustained fire. The longer attackers are in the sea, the worse, but it has to be this way.
SPG can engage landing craft when they're performing their landing runs - full of dismounts and unable to fight back - and when it'll be especially hard to counter them(least amount of available fire, highest need of suppression). Guided projectiles make them particularly nasty.
SPG can attack marines after landing, when they're at their most vulnerable. At this point, Defender still enjoys fire superiority over 122mm amphibious howitzers of first waves - and, arguably, at the last moment when defender actually has a chance to contain the landing.
SPG will simply perform normal high-intensity land combat afterward. They're still annoying to counter, and the land army absolutely can't fight without artillery support.
Yes, guns will be suffering losses, probably quite fast, at all stages. It's kinda normal for them, as it was for many centuries.
ASMs, air defense systems, and coastal ASMs perform
completely different roles.
All in all: no, this is a serious purchase with serious implications. And it has to be taken as such.