Most examples boil down to common sense. Nobody is going to arrest a 14 year old for driving their dying parent to the hospital.
Similarly, it is reprehensible but legal to pull up a chair and watch a child drown in a pool.
There is a difference between law and morality, and humans will use the second to selectively enforce the former.
In which country? Even for the US I don't believe the law system is that crappy.
There's video from a few years back that shows very American cops standing outside a burning house at night, knowing there was a young child still in it. A passing pizza delivery dude[1] rescued the 6-year old, handed her to cop, and ended up requiring hospitalization. In the online discussion, everyone called the rescuer a hero, but I don't recall seeing a single condemnation of the cops (a "first-responder") who didn't enter the burning house.
edit: 1. the hero's name is Nick Bostic https://www.youtube.com/watch?v=sBlE52qKKuw
Example: After a missile attack on a Dnipro gas station in 2022, my wife and her team arrived to see the station burning and 3 people already confirmed dead, but the paramedics would not go inside (they actually weren't allowed to, due to the danger). Her team was military, however, so it was OK to go in and check for survivors.