Vicious kid is an actor with a lawyer who understands that and gives him advice on how to play the jail and courtroom scenes.
Los Angeles courts normally appoint a psychiatrist to provide a professional evaluation.
I once served on an L.A. jury, and the case was canceled mid-trial. The judge said the defendant had been acting increasingly erratically during the proceedings, and that a psychiatric evaluation indicated he was no longer competent to stand trial.