This is a completely fictitious scenario from a roleplay in a video game set in America, but say a person who is an undercover cop hires you to kill their spouse, you take the money and then they arrest you- however you're told by a cop part of the sting (with bodycam evidence) that the person you were hired to kill doesn't actually exist. Does that still constitute a murder-for-hire charge? Is that a technicality a good lawyer could fight and win in court? The game law is based off of California's.
Yes to attempted murder and conspiracy to murder. No to murder
Although the particular example you raise looks like entrapment and law enforcement can’t do that in the United States.
Putting that aside, factual impossibility is not a defense in common law jurisdictions. Conspiracy to murder someone who can’t actually be murdered (because they are already dead or, as here, don’t actually exist) is still a crime.
Legal impossibility, however, is a defense. Something is legally impossible where it is impossible to meet one of the elements that define the crime.
Most crimes require that something physical be done, for example, murder requires the perpetrator to kill the victim (among other things), so you can't commit murder on a dead or non-existent victim. However, crimes in the nature of "Conspiracy to X" or "Attempted X" often only rely upon intention even if it is impossible to do the thing intended.
To illustrate the difference:
- if it’s illegal to smuggle cocaine across the border and I, being an idiot, get caught smuggling what I think is cocaine but is actually table salt, I’m guilty of attempted drug smuggling. This is factual impossibility but a legal possibility.
- I'm not guilty of drug smuggling because that crime requires that I actually smuggle drugs. This is both a factual and legal impossibility.
- if, however, the day before I do it, the law against cocaine is repealed, then whether I smuggle table salt or actual cocaine, I’m not guilty of either crime even if I think it’s still a crime. This is legal impossibility.
It's obviously not murder, but could be attempted murder or conspiracy to murder. Each of these scenarios has a different problem.
For attempted murder, a court would have to prove beyond reasonable doubt that you attempted to kill this person. And not for example that you just took the person's money and had no intent whatsoever to kill someone. You would need to do something that would be a step to committing the murder. Of course kicking in the door of the house where the wife is supposed to live with a loaded gun in your hand would look bad for you, but if you take no action at all then attempted murder would be hard to prove.
Worst case for the undercover cop would be if you knew that he was an undercover copy with no wife, and your plan was to take his money and laugh into his face (and another question is whether you would have any obligation to return the money).
For conspiracy to murder, you need two people conspiring. Even if you intended to take the money and kill the spouse, the undercover cop didn't conspire, since he knew there was no wife. So that would be a difficult situation for a court. However, the court might decide that the cop's actions created a real risk that some woman would be killed. In that case I suppose you are both guilty of conspiracy, and if this is possible, then it would be an utterly stupid thing for the cop to do.
I am quite sure that there have been cases where someone looked for a murderer for hire, found someone, paid them, and the supposed killer went straight to the police.