If not then how does a child develop social anxiety?

Yes, a baby can be born with social anxiety. I can learn it in the womb.

A child can also learn it four other ways:

1 by experiencing a situation where the child is upset by an event (classical conditioning)

2 watching a person be upset by an event (social learning)

3 be told a story of a person being being upset by an event (social learning)

4 Being rewarded for being upset by an event (Opponent Conditioning)