My parents' border collie used to bark at small children, probably about the age of your grandson, when she was a young dog. We figured it was because she hadn't been around such small people before! She eventually got over it, but we also figured out how to get her to stop. Give the kid a Frisbee. That bc is a Frisbee maniac, so eventually it didn't matter how small the child, she didn't care as long as they were throwing the Frisbee for her. Now she's 9 yrs old, and she's been to so many Frisbee demos with small children, participated in their church VBS, and she even does a demo for my Mom's kindergarten class every year, that she's not bothered by small children. So perhaps you can have your grandson offer your dog treats, or his favorite toy. Make your grandson somebody that brings "good things" to your dog, not scary things.
My sheltie met her first "baby" at Easter. This baby turned 1 in March. She's my Aunt's niece from her husband's side, so technically no relation to me, but since I'm very close to my aunt we'll just say this baby is my cousin. At the time, she wasn't walking yet, but she has 2 dogs at home and loves dogs, so she kept crawling to get Missy. My sister and I sat on the floor with Missy and let the baby crawl over, and kept praising Missy for letting the baby "pet her" and then also make sure the baby didn't pull her hair. Then Missy was done, and the baby wanted her, but Missy can walk much faster than the baby can crawl, so Missy kept circling from the kitchen to the living room, and all we could hear was "click click click" really fast on the tile. We let her go outside to play with the dogs after that, because I didn't want to stress her out and make her afraid of toddlers. When we saw the baby again at my brother's graduation party, she wasn't as anxious about the baby and kinda just ignored her and scavenged for dropped food.