You don't have to reliably block something to make a law against it. Murder is illegal despite the government not figuring out how to reliably stop people from murdering each other.
So many people miss this in such discussions. Like that Australian politician’s “the laws of physics are all very well, but the laws of Australia are the only ones we care about” which was widely ridiculed in technical circles that did not grasp its truth: that law is all about declaring physically-possible actions illicit.
However, to address your specific chosen example, one could argue a difference from murder, if they say “your site must block these traffic sources or you’re in trouble”: one could argue (it’s not at all cut and dried) that it’s like saying that venues are liable for the murders committed at them, rather than the murderer.