We had a similar situation with DD when I was pregnant so she would have either been late three or just turned four.
Went to an outdoor national trust type place and they had a massive park. DD really struggles to assert herself/put herself out there and we had started encouraging her to be more brave/independent.
She had gone up to a little boy who had a bucket and spade and asked if she could play with him, they were having a lovely time, sharing really nicely and I had gotten chatting to his Mum who had just found out she was pregnant. A girl came up and tried to snatch the bucket off them.
DD and boy shouted out at her to stop, it was theirs etc and little girl suddenly starts screaming like a banshee, trying to scratch and hit the boy who was gripping the bucket.
His Mum went up and beached whale bootothegoose taking a minute or so to get over. Mum has it handled with a diplomatic 'no we don't hurt each other, that's not nice. Where's your Mummy?' Girl instantly composes herself starts to reply when the Grandmother suddenly appears, ignores both me and boys mum and starts berating the children for not sharing/being nice and saying toys are for sharing. If they can't share then they can't play with it. Girl instantly starts wailing again.
Boy's mum gave a firm, they don't have to share with anyone who hurts them, that they were her son's toys and she had no right to say what they could do with said toys and takes bucket.
Grandma picks up child, still screaming, looks directly at mum and says 'watch your attitude, young lady.' before walking off the park chanting 'nasty children, nasty toys, nasty mummy' to the little girl.
In my ten years old parenting it was the strangest experience I've ever had. I was stood there completely lost for words and I was glad it had been the boys' toy as if it was DD I don't know what I would have said/done. I think you were very diplomatic.
YANBU, whether it was needed or not, you always have the right to know why someone is speaking to your child. We don't waggle our fingers in the faces of anyone else's child, be-it justly deserved or not. We ensure all parties are safe and if they are being unpleasant/stopping our children from playing (not as in our child wants a turn) we calmly assert boundaries and ask them to stop/redirect/encourage our children to ignore them.