As PP said, check for constipation.
On the other hand, it might just be a kind of regression - DD did this, she potty trained fine, got loads of praise etc then when it became normalised and she got bored of it, she stopped bothering and had loads of accidents. You have to remember that kids' empathy for your cleaning and convenience is at psychopath levels - they don't care about you cleaning up horrible messes. They just think about what's in it for them. Make the clean-up drawn out and boring (telly off, toys away, get them to help mop etc) and continue to praise for success.
I get why you would use the word 'stubborn' but I'd advise you to change your mindset about it as it's a really negative word that implies 'you should just do what I want without protest and if you don't, it's because you have a negative element to your personality.' Parenting is a long road and that mindset will set you up for more conflict. I say this as someone who was called stubborn throughout childhood and also as the mother of a 6.5 year old who could also be called stubborn!
Instead, think about how your child is on a long journey to independence and sometimes wants to claim some independence by not just doing what they're told all the time. He might just not be able to deal with his feelings sometimes and gets stuck in defiant mode because he's overwhelmed, it's easier to take a gentle approach to helping them work out of this than going in with an oppositional 'you're stubborn' way of thinking.
Basically, you need to be on the same team as your DC.