Suppose P has a 1% chance that it destroys the Earth as soon as it's created, whether it's in the hands of people who follow laws or not.
We pass a law saying: "You cannot have P."
The market incentive for producing P is now vastly reduced, because the black market is a fraction of the size of the real market, so P never gets built in the first place because it takes a lot of investment and expense to do so.