I actually disagree. I assume every law is subject to "at the discretion of the DA/judge" (or whoever is in charge). Do you think everyone needs to account for every emergency circumstance possible in every law? In real life, there's the law and then there are mitigating circumstances.
(A few years ago I could have said "we don't get ticketed by an AI that only follows the rules it was given." Well, we do now in many places and that's a problem.)