I think there are three small mistakes in your reasoning.
Firstly - speeding because you're about to give birth is still speeding. It still puts you and other road users at risk. In most jurisdictions it doesn't get you off a ticket. In the UK, you aren't allowed to cross a red light even if there's an emergency services vehicle trying to get past.
Similarly, just because you can't see anyone on an "empty" road, doesn't mean they aren't there. So, yes, it is a big deal to break traffic laws - despite what most drivers think.
I can easily imagine a car with a software-enforced speed limit. Need to go faster to escape a tsunami? Press the big emergency over-ride button. That can send an alert somewhere and you can justify your decision later. Perhaps the courts are sympathetic to your excuse, perhaps not. It stops people "casually" breaking the law and allows nuance if necessary.
Secondly, the law also unreliable - it has bugs, edge-cases, and loopholes. It can take years to adjust. Software can be tweaked OTA.
The law also fails in spectacular ways - look at the abolition of Imprisonment for Public Protection sentence (IPP). That's caused all sorts of weird issues. So we're already living in a system that sometimes goes wrong.
Finally - this isn't the future, this is now! My electricity provider already sends a signal to my battery telling it the prices for the next 24 hours - and my battery can decide whether to charge or not. If I had an electric car it could use V2G (Vehicle To Grid) to help balance out my energy usage.
Will their be vulnerabilities in a new system? Yes. But that doesn't mean we should forgo all its benefits.