Indeed it is recognized that a plea bargain is on its face a sort of perjury - an agreement to plead to a lesser crime for reduced sentencing. It's a contract and it's only invalid if induced for force of fraud - both of which apply here.
"If you don't cop to a lie we will destroy your son!", so he cops to the lie then gets charged with perjury because they knew it was a lie.
Where did this judge get his law degree?