Most kids repeat swears to get a reaction.
My wife and I swore like sailors and just told the kiddo which words she shouldn't repeat because they would upset other people, and that saying them at home would make it easier to slip up outside the home. We could do it because we had more practice.
It actually worked until middle school.