Yeah, he could have just told the lawyers to leave so he could talk to the youth privately. It was still a good idea though, just not the right way to go about it.
I was in court one day as a witness and someone came up that was a repeat offender. The judge was basically asking "what are you doing with your life? this is like the 3rd time I\'ve seen you in my courtroom". I could tell he wanted to help this guy instead of just throwing the book.