I think they were shocked and acting in the moment, not analyzing the situation to think about what “message” it would send.
People who are shocked at witnessing a murderer don’t naturally decide to hug the murderer and not the child witnessing the murder.
You seem incredibly invested in defending their actions.
Of course, if one views it as a kind of gang initiation, a “Welcome to the club” hug might make sense.