"I object, Your Honor. What precedent are we setting here? That the defendant isn't actually the defendant?"
— An American Pickle (2020)
Suppose that a man that society identifies as Herschel Greenbaum is put on trial for a crime that Herschel Greenbaum allegedly committed. However, his attorney claims that the defendant is not Herschel Greenbaum, but another person, Ben Greenbaum, and thus he is innocent.
Would such a defense be possible? If so, how the trial would be handled?
My perplexity is that the purpose of a trial is to establish the innocence or guilt of the defendant, not to establish that the person in the courtroom is the actual defendant.
Note: It seems that my question is somehow unclear. To make it more clear, you can image that the prosecutor has very compelling evidences against Herschel Greenbaum, and that the judge, the jury, and even the defense are quite convinced that Herschel Greenbaum is guilty. Can the defense prove that the man in the courtroom is not the real Herschel Greenbaum? If so, what happens? Is the verdict: "Herschel Greenbaum is not guilty," or is it: "Ben Greenbaum is not guilty," or is there no verdict and the trial is canceled, since the defendant was the wrong man, or something else?