'You could have killed that officer,' Sudbury judge tells dr