Question: I don't know if my question is philosophy, law, history, ethics or none of it, but I imagine a scenario where an obviously evil and criminal act with the intent of malice has the result of utility and good. 

For example, imagine if Charlie is going to the cinema and on his way to the cinema I stop him and I rob him of his money or even violence towards so that he cannot complete his visit to the cinema and maybe needs to go to the hospital or the police station instead. On the occasion the cinema where Charlie was going to is attacked by a bomb or terrorists and everybody at the cinema dies. It becomes clear that Charlie would have been dead if I had not committed the crime against him. 

Or similarly if I with malicious intent make somebody miss an airplane where everybody dies. 

Was there such a situation in real history and how would that be thought of, considering that the criminal only had evil intention but in fact he saved the life of the victim. Would that even change a verdict or the ethical conclusion what was the right thing to do?

Answer: 
It's on topic here
------------------

You are asking about the legal implications of a given set of facts - that's what we do.

With a few minor tweaks, you could be asking about the philosophical implications - that's what Philosophy does.
We don't do ethical questions here, that's what Philosophy SE is for (it might even be a FAQ). We can deal with the legal implications.