Protocol is particularly important as a lawyer appears in higher courts - appellate courts and supreme courts. Federal courts are notorious about holding lawyers' feet to the fire for failing proper protocol. I once saw a federal district court judge scold a female FBI agent who was a witness for wearing a pants suit instead of a skirt suit. I also once saw a federal judge harshly scold an attorney for failing to immediately stand upon addressing the court.
Judges are in charge of the courtroom, and are generally the people deciding the outcome of a case, particularly once you get past trial. Even in trial, they make many legal rulings along the way that can greatly affect the outcome. Many believe they can even have an influence over a jury's decision at trial.
In short, a lawyer should try to keep the judge or judges happy. Or at least try not to irritate them. Failing to follow proper protocol (even a judge's idiosyncratic protocol applicable only in his or her courtroom) is one of the easiest ways to irritate a judge.
Some examples of courtroom protocols include: standing when speaking; addressing the court as "Your Honor"; stating "May it please the Court," before beginning an argument; asking to approach the witness before walking up to the witness stand; asking to move anywhere in the courtroom before leaving the lecturn; not making "speaking objections"; and keeping out of "the well."
To maintain authenticity in a fictional work, a writer should be aware of the common protocols in the courtrooms about which they are writing, so their fictional judges and lawyers may act accordingly.