You got lucky! He could have nailed you
And he could have found the entire courtroom to be in contempt and jailed them all just for the fun of it. If he was a nut.
He could have "nailed" him, or held him in contempt only in the sense that he could have held him in contempt because he didn't like the color of his hair.
Some of you people seem to be confused as to the country you live in. Contempt has a meaning. "Contempt of court" has a legal definition. Talking to a judge is not being contemptuous. Asking a question is not being contemptuous.
There was absolutely no grounds whatsoever for a contempt charge. NONE, NADA, ZIP. The bottom line is that a judge is free to abuse his power any time he wants. If the judge was abusive, he could have held him in contempt, but if you're going to assume that all judges are that abusive, then we have a very serious problem.
He complied. He asked for a clarification. There's no way that any sane person can construe that as being contemptuous of the court.