In the fact pattern you've given, we're getting dangerously close to prosecuting a judge for official acts taken in their courtroom. The only difference is that, in your fact pattern, the judge is doing this in bad faith, with the express intent of assisting this person evade arrest.
A Judge is required to maintain order in their courtroom and ensure that the docket runs smoothly. A bunch of ICE agents sitting in the gallery could definitely be interpreted as disruptive. If this defendant saw that or knew that, he would be likely to run. If ICE was going to arrest this person in the middle of a courtroom, that would also be disruptive. A judge is well within their rights to remove people from the gallery if they are going to pose a disruption.
Additionally, this is not new. Defendants walk into court with open warrants all the time. Police are not allowed to walk in and arrest defendants in the middle of court. I don't understand why ICE would be special.