I don't like this law, it blurs the relationship between action and responsibility.
Say Al robs two liquor stores, accompanied first by Bob and then by Carl. The first robbery goes as planned and they run off with the till. In the second robbery, Carl freaks out and shoots the clerk before they run off.
If Al gets caught for the first robbery, he's charged as a robber. If he gets caught for the second robbery, he's charged as a robber and a murderer, even though his actions and motives are exactly the same as the first.
I don't like laws that tack on an "you got unlucky" penalty to the penalty for criminal actions and motives.
The question of what to do when an illegal or irresponsible action leads to disproportionate consequences is a good one. In New England, we had the case of the Station nightclub fire.
Basically, a band went on stage at an overcrowded nightclub and started their act. The stage had some soundproofing on the sides to prevent massive echoing in the space, but this was really just packing materials that were not fire retardant.
The band and the nightclub owners disagree on whether or not the band had permission to use pyrotechnics, but three sparklers were used in the show. The soundproofing caught fire almost immediately and in less than a minute, the entire stage was in flames.
Way too many people raced for far too few exits, and within an hour the nightclub was burned down and a hundred people were dead.
Even assuming the worst intentions, all the band manager wanted to do was set off some sparklers without permission, yet the consequences of his act were horrific. He was sentenced to four years in prison, and people couldn't decide if this was fair or not. Some people thought that he should spend far more time in prison for the deaths of almost a hundred people.
You also had the club owners, who did not have a sprinkler system installed as required by law, but no one had noticed including fire inspectors (The building was very old and was thought to be exempt, but they had changed the building from a restaurant to a nightclub and lost the exemption without realizing it). One recived a four year sentence, the other had his prison time suspended.
How do you judge something like that?