It's bound to happen. During the trial the judge has a few questions for the witness. The judge is getting antsy. He's not getting the information he wants immediately.
The judge turns to the attorney and says “Hold on a second counselor, I have a few questions for this witness.”
The Judge then proceeds to ask the witness questions to satisfy his curiosity. After the judge is done he will likely turn to the attorney and say “You may continue counselor.”
What if I am the attorney who is questioning the witness and I do not believe that the judge is asking proper questions? What can I do about it?
What if I did not want to ask those specific questions that the judge was now asking? Is there anything I can do while the judge is asking these questions of this particular witness?
The answer is that the judge is in charge of controlling the courtroom. If he wants to ask the witness questions, he's certainly going to do so. However, what if those questions and those answers somehow cause or contribute to a verdict against my client? Is that grounds for appeal?
It might be.
The only thing that I would be able to do if the judge interjects and I feel that his questions are inappropriate, is that I would have to object to the judge's questions. Naturally, the judge is going to overrule my objection and continue asking the questions he wants answers to. However, by vocally objecting I am preserving my right to address this issue on appeal if we lose the case.
Whether or not that would be an appealable issue is a different question.
In reality, the judge will claim that he had questions that the witness was not answering and would expect that the jury would have similar questions. He was simply trying to clarify issues in the case.
However, when conducting cross examination I have an agenda that I need to get through in order to establish certain facts and key legal requirements to make out our case. I may want to discredit this witness. I may want to use this witness's testimony to bolster my own expert's testimony. There are many strategies and tactics that can be used when cross examining a witness and if the judge interrupts and asks questions that are unrelated or even harmful to my goals, then that may have an ultimate impact on the jury's verdict.