The "contempt of court" charge basically serves as a court-private time-out box to send people to whenever they can't handle being in court, until they learn to stop, erm, "blocking the cooperative event queue from pumping messages."
It's not that the charge has to be indefinite—but it has to be capable of sticking as long as the trial's progress is halted. The charge should definitely cease to apply if the trial manages to resume through some other route—and especially if it manages to conclude.
Remember, "contempt of court" isn't about malfeasance, either. Experts who lie on the stand are not in contempt. Lawyers who introduce non-cross-examined evidence are not in contempt. Random audience members getting up and saying things during court are not in contempt. It's only when one of these things causes the trial mechanism to grind to a halt, and then the person refuses to yield to let the trial resume, that they are in contempt. It's a process-control mechanism, and in that respect, it's quite necessary.
(That's not to say it can't be abused—especially in smaller courts in non-jury trials. But it has a well-defined good usage, and can't really be redefined without losing that usage.)
The rights of protest and speech cannot be the same in courts, even to the same degree as a place like congress or the offices of the executive. (And in those last two cases, the right of speech is also curtailed.) Otherwise, the courts wouldn't be able to function, particularly in the case of an adversarial court system.
As an analogy, years ago I was part of a small alliance in Eve that consistently won battles. But as we were winning, the server would crash and the devs would come in and roll-back the damage we had done.
The courts have a hard enough time as it is functioning. I am involved in a case against an assailant, and I learned that it's very typical for defense attorneys to purposely drag out cases to maximize victim fatigue. The defense attorney somehow has surgery scheduled on the hearing dates. A legal system is very complicated. It's likely to have more loopholes than a software system has bugs. And it's probably a lot harder and more time consuming to fix those.
This is why "contempt of court" exists.
Why would there need to be any place for unfairness to reside in a system?