Any child can be shy, nervous, uncertain, embarrassed, non tactile, neurodivergent, or even just not well disposed to a particular older person. For any or even no reason, they may not want to be hugged. That is their right.
Involuntary hugging is assault. A child is a person.