Saw something like this once...
Defense attorney got mad because prosecutor was trying to introduce evidence that defense attorney thought was inadmissible. Judge excused the jury to allow for full argument on the record without risk of prejudicing the jury. Defense attorney leaves the courtroom for a moment, then walks back in and sees the empty jury box, and goes ull on tirade at the prosecutor about bringing up his client's prior convictions for drug dealing. Judge yells for them to shut up, but it's too late. Several of the jurors were standing right behind the defense attorny, leaving the courtroom after coming back to get their jackets and sweaters.
Case was a mistrial, as the evidence was not admissible, and the defense attorney got stupid bringing it up in front of several jurors. Judge less than happy, orders the cost of the trial, to that point, divided equally between the two lawyers, the prosecutor for bringing up the evidence in the first place, and the defense lawyer for blowing it in front of the jurors. Cost for everything came to about $2,500 a piece.
Gotta love a judge who uses common sense and protects the public from crap...