Your son might be one of many children who do not respond well to punishment. His deliberate potty accidents are a sign that things are not going well in the discipline department. Too much discipline and punishment are often the problem, and he may feel he has no other way to protest other than to defy you.
Surprisingly, many, perhaps most, children can be raised happily and successfully without punishments delivered as scolding, deprivation, taking away toys or privileges, spanking, or even time-outs. Children crave your attention and high regard almost more than breath itself. If you have him labeled as defiant, your son has almost no possibility of hearing from you how much you appreciate him.
I hope you'll break that pattern, which can only spiral downward. Instead, try the alternative methods taught in the wise and wonderful book How to Talk So Kids Will Listen, and Listen So Kids Will Talk. The authors Faber and Mazlish have years of experience teaching parents how to work as a sympathetic team with their children, finding solutions together to all sorts of classic behavioral problems.
The book is a pleasure to read, very easy to understand, and it coaches you along a little at a time. It's filled with cartoon examples of what not to say, and what works better. While the library should have this to loan, you will want to invest in your own copy, so you can make notes and dog-ear pages.
My 4.5yo grandson has occasional behavioral problems and bad days, and because of this empathetic approach, he almost never gets punished – but he does get natural and logical consequences, and his parents are very clear about their expectations and rules.