Baby play date question!

Ke

What do y'all do when your babies are grabbing and smacking?? My son smacked my friend' baby's forehead HARD. And he was frustrated because he wanted her toy. He is 8 months and my friend's baby is 5.5 and she is not as mobile as he is. Well I said "no" in a very stern voice and pulled his hand away. He fussed a bit once I pulled his hand away and said no, but didn't cry. I didn't see an issue with my reaction, but my friend keeps telling me babies don't know what they're doing and she's just going to distract when her daughter gets to that age and nicely pull her hand away. I am not sure if I'm having the wrong response by being stern and showing my disapproval of my son's behavior?