It is a misunderstanding of the “electrical shock” procedure.
It is depicted in films incorrectly, as paramedics shock the patient when the pulse stops and the ECG appears as a straight line like this.
But the truth is that such electrical shocks are used to treat ventricular fibrillation, which looks like this on the EKG device
In this case, the ventricle beats quickly but weakly, not enough to pump blood out of it, and this condition causes death
An electrical shock to the heart depends on stopping the electricity in the heart for a short period in the hope that it will return regularly (the same idea as rebooting to solve a problem in your phone), but in the first case there is no electricity coming from the heart in the first place, so such a procedure is useless.
To clarify: the heart has an electrical nervous system separate from the rest of the body and is controlled by the “sinoatrial node” shown in the figure.