Gotta Be Respectful
In ancient feudal times, “Your Honour” was a formal address for anyone with a title, including royalty, knights, judges, and even wealthy landowners. This practice remained to this day because judges in a courtroom are still considered of higher stature and have power, so they deserve to be treated with respect.

However, cursing and yelling at the judge is definitely not respectful, and calling him “your honor” doesn’t change that. It pretty much cancels out each other. On the one hand, it’s nice that he respects him enough to refer to him as “your honor,” but at the same time, he clearly doesn’t have much respect for him if he challenges the courtroom that way.