Being on trial is a stressful setting, no doubt about it. And sometimes, in a stressful setting, we say things without thinking them through. Maybe that was the case here? Maybe this was a slip-up this person didn’t think through. Otherwise, I can’t imagine why he’d challenge the judge that way!
I don’t know what the usual jail time for assault is, but to me, it definitely sounds like it ought to be more than six months. Maybe this defendant was surprised by that verdict, expecting to get more time, and he made this slip-up because he couldn’t contain his surprise.