You have no evidence to support that claim.
Quite contraire.
The prosecutor would never have granted him immunity from prosecution if he had known that he was going to confess to killing the victim from the witness stand. Never.