Let's say I've been accused of a murder. Throughout the investigation I've plead the Fifth as to where I was when the crime happened. Eventually I'm put on trial, still pleading the fifth as to my whereabouts during the crime.
Then, when put on the stand during the trial, I finally tell the court, and jurors, that I had an airtight alibi the entire time and have just refused to share it until now. Let's say the alibi could result in some trivial criminal charges being filed, like loitering, so I do have the right to claim I had reason to fear bearing witness to myself.
I'm wondering what would happen at this point. The prosecution wouldn't have had a chance to prepare for this revelation, but they can't say that I or my lawyer acted wrongly if I only now decided to testify. Would this be cause for a mistrial?
Would it matter if this was a legal strategy? For instance what if I tell my lawyer "I don't want to reveal my alibi unless you think there is a greater then 50% chance the jury will find me guilty." Can my lawyer continue as normal, knowing I may surprise the defense if I deem the odds of going to jail too high, or is he in a position where he has to say something once he knows I'm intentionally withholding information to surprise the prosecution?
As to why anyone would do this, I can think of two reasons. 1) I know who did it and was willing to take the chances at court to protect the real person until it became clear I'll likely lose, 2) I did the crime, but the prosecution has the theory of the crime all wrong, and so I'm intentionally looking to undermine the prosecution by surprising them with an alibi in hopes of convincing the jury that the prosecution didn't do their 'homework' and thus I'm innocent.