When I saw the caption of your post, I thought it referred to one of the verses I know in the Bible, that says that "Out of the mouth of babes and sucklings, you have ordained praise."
It may not be what you were referring to but it still seems to fit in my opinion. I remembered how confused I was when I heard a whole string of expletives for the first time. The person was saying a full sentence but there were more f-words than actual words. And I kept saying to myself, "they seem to be having so much fun."
I never got to actually use it till I became an adult and when hot water got poured on my hand mistakenly and I said it, I felt really bad. Somehow though, I got used to saying it when something happened. But each time I say it, I cringe inwardly. I don't think you were harsh at all. I think you were teaching Ben and your children by extension that every place they step foot into has its principles and values and as far as you're there, they just have to be respected.
The biblical reference is a famous one and it is indeed fitting here. You also thought that the person swearing was having fun. It is confusing for children. Swearing is now commonplace in our society - some adults like yourself might swear and cringe. The difference is that as an adult you can decide when to swear. If children are not corrected - they will think it is normal to swear whenever they feel like it - no cringing. 😀
Yes you got it right - my children and Ben learnt lessons that day.