A death row inmate is beaten and suffers amnesia, a psychologist works feverishly to prevent his execution.
He knew at the time of his conviction. Good enough for a judge and jury. As to whether your scenario is a plausible legal justification to get him off death row, I dunno. Have you researched the actual legal ramifications of your premise to see whether the convict would have a case and you a credible plot?