Although this argument seems logical, it wrongly assumes that criminal activity is premeditated and rational. In most cases, people commit heinous crimes while overwhelmed by strong physical impulses such as rage or sexual desire. Crime is carnal. It leaves no room for rational thought.
As a result, reason is often not a part of a criminal's decision-making process. The criminal will not stop to consider the risk of execution, because reason does not motivate crime. Evil impulses motivate crime.
Additionally, if a person stops to consider the risk of execution, he or she can easily dismiss this concern with an assurance of avoiding this punishment. They can avoid the death penalty through evading arrest, hiring strong legal representation, or twisting the crime's narrative. For these reasons, the death penalty does not deter crime.