For example… Speeding
Going down the highway doing 10 oven the limit and you get pulled over an dgive a hefty ticket… But Nothing bad happened.
Another example… Letting a Tesla do full self driving but you aren’t paying attention. The car is driving itself quite well but you are ticketed for undue care and attention… But there was no accident or anything… Nothing happened.


Same with killing if you are caught by the cops, you should be free to go home.
hahahaha
I understand what you are trying to get at but those 2 things are equivalent, that’s comparing apples to oranges. Also someone died in your example which anyone would believe to be “something bad” happening.
The real answer to OP’s question is because the laws that are in place are to be enforced regardless if anything bad happens so everyone is held to the same standard. On the other side of that all citizens are expected to follow the same rules/laws regardless of anyone being around to enforce them. These 2 things are the basis of any society to function in any meaningful way.
Yeah, I was about to mention Sideshow Bob making the same argument that attempted murder shouldn’t be a crime.