An 18-year-old about to be sentenced for murder has allegedly been attacked in a courtroom by a young man believed to be a member of the victim's family.