Obviously, a courthouse generally is a place where there are numerous witnesses and surveillance cameras. It is also a place that is generally filled with police or court officers. If a crime is alleged to occur in a courthouse, it can be hard to defend for those reasons alone.
Additionally, there is sometimes a concern about whether you would get a fair trial in the same court where a crime allegedly occurred. Court personnel could be witnesses and could play roles in the prosecution, trial or sentencing. It is easy to imagine a situation where decision makers could be improperly influenced by their own personal or professional relationships with their coworkers who could be witnesses, or even victims.
Under the Massachusetts Rules of Criminal Procedure, you are entitled to ask that a case such as this be transferred to another court. Essentially, there would need to be a finding of prejudice against you in the court that would otherwise have jurisdiction over the charge. The transferring of venue, enumerated in Massachusetts Rule of Criminal Procedure 37, is not mandatory however, and generally must be requested by the defense. It would be a good idea to have a knowledgeable attorney by your side to properly advocate for this kind of relief and to ensure your fair treatment in court.