You cant legislate secure software into existence.
And a lot of the security problems we have now are direct consequence of 40 years of people trying to use government coercion (which can’t secure anyone against cyber attacks) instead of sound engines and good practices.
More shifting liability around isn’t going to fix anything.