Hi J.!
Thats a difficult one! I only have a two year old but my mom taught Pre-K for over 35 years. I have a lot of experience with 4-5 year olds with this problem, and 6 is pretty close:
I definitely would not punish him. I wouldnt ground him or threaten him either. In fact, I would take him out to the park, play together and talk to him quietly and gently once he is in a calm mood. Ill get to that in a sec. What I first wanted to say is, 6 year old still feel out-of-control when there are changes in their life sometimes. If your son is a sensitive little soul, your new marriage and pregnancy are putting stress on him. It's not anything you did wrong, but you DO need to understand why he is backsliding on the potty training: it is basically the one thing he has 100% control over!
When kids feel out of control, they try things like this. Some kids decide not to eat, some kids try to control bedtime, etc.. your son just chose this method to feel more in-control of the changes happening around him. I would make a huge effort going forward to keep a good routine going for him. I would also reinforce your love, support, J. for the new coming baby and let him feel control over being a big brother. Involve him more.
You might need to take him to a child psychologist if it continues and you have insurance to do so. I would try a little TLC and change in technique before you go to that step.
But....back to how to change technique, IMO:
I would explain that you were very sorry that you and daddy grounded him and you guy just want the best for him. Tell him that you are there for him and understand he hasn't been feeling very happy recently. Tell him he can talk to you anytime he wants and you will try to spend more time with him.
Then, (or better yet before), talk to your husband and agree to both reinforce this new technique: no more getting mad and punishing it. Make sure your husband is on-board with this too! It won't help to have you turn it around but have him still say "I can't believe you are pulling this again. Stop it!" (etc)
I am completely positive that this is just his way of dealing with new stresses in his life. It will turn around once he manages the stress. Hope this helps.