Was watching a police drama (a classic "Taggart" episode) where this was a plotline.
A wife shot her husband while he was "sleeping", and subsequently confessed to his murder. Yet (this being Taggart) it turned out that the husband had actually been dead at the time she shot him, having previously been stabbed by another party.
If this situation were to occur in real life (exceptionally unlikely as this might be), what, if any, crime would the wife have committed? And what punishment would she face? Presumably, she presents as much danger to society as someone who had actually killed their husband would do (since she has proven that she is prepared to kill someone, even if she actually didn't), so if part of the purpose of sending criminals to prison is to remove dangerous people from society, logically there is no more or less of a reason to lock her up than there would be if the husband had been alive when she "killed" him. On the other hand, the other purpose of sending criminals to prison is to get justice for the victims of crime, and in this case, she has not actually committed the crime.
Taggart is set in Scotland, where Scots Law applies, but answers from different legal jurisdictions would be welcome.