Yes, that is wrong. That IS wrong for him to be swearing, absolutely. But it is even worse that your parents do that when they are the ones that basically taught him to curse.
When I was younger my parents would use horse radish, or soap. I learned after the first time not to do it again.
I think that's cruel, and shouldn't be done. If they don't want him to swear, then they shouldn't swear. If I were you, I'd talk to them about this and tell them it's wrong. Or if they get mad at you for that, tell someone else. It's especially wrong because he's only 3, it's not like he knows what any of those words mean. That's wrong and should be stopped soon.