The devil is in the details - laws like that can have tons of exemptions, and likely will.
If there's both a plausible alternative fuel on the horizon _and_ a plausibly problematic law, _and_ a political unwillingness to grant exemptions - then let's talk. So far, laws even vaguely in that direction seem few and far between, and even those make it might turn out to have loopholes rendering the point moot. The conventional fuel industry and popular usage is so huge that surely exemptions would be granted if necessary. Finally, there does not yet appear to be plausible alternative fuel.
The risk of an overzealous restriction on ICE cars is much lower than the risk of an overly lenient ICE policy. After all, each additional ICE car sold has real, likely unavoidable, and virtually irreversible consequences. In aggregate, those consequences are pretty dire. Betting on some kind of hail mary wonder-fuel without considerable certainty of its success isn't wise. But it's also likely what society will do for quite a few more years.
Under an idealized capitalist system we'd just tax the carbon and thus raise the fuel prices. However, as long as much of the electorate has ICE cars that's political suicide in most places - and competitive suicide even where the body politic might swallow that bitter bill. Consider e.g. the proposed small fuel price tax hike in France recently and the unrest that followed. Raising fuel prices isn't easy.