There used to be a policy in Hollywood, dictating that evil deeds would not go unpunished before the film was over.
That policy, seen mostly in films from silent movies up to “Clockwork Orange” has for the most part disappeared.
Today, it’s up to each director and screenwriter, how they decide to tell their story.
As I recall, it was also forbidden to have a shooter in the same frame as who he was in the process of shooting. Also, couples could be in the same bed as long as each one had a foot on the floor. I always thought it was crazy that married people in 1950s and later series slept in twin beds.
It was part of the Hayes Code. If you watch old episodes of Alfred Hitchcock Presents the show might end with the evil person seeming to get away with a crime, but in the ending monologue Hitchcock always informed the viewers that the person was eventually caught.