A NSW district court judge has been slammed after she invited a teenage criminal appearing before her to be sentenced over home invasions, to give a welcome to country in the middle of her courtroom.