Pretty sure the deal is that the judge’s main job is to ensure that the conduct of the trial follows the file of law. If it can be shown that he didn’t do that, anyone can call for a mistrial. But I’m a software engineer, not anyone who has any training in this stuff.