A magistrate has slammed the actions of a man caught hooning near the scene of a crash that killed his friend.