P.M.
My almost-always-polite 5 yo grandson occasionally experiments with tone of voice or body language that is less than lovely. Sometimes kids pick this up from other children, videos, etc. Sometimes it's the parents themselves that teach sarcasm, irritation, impatience and bossiness (it's SO hard to hear ourselves as others hear us!). But, whatever the source, it's an experiment, and may also be a legitimate expression of frustration or anger.
Consider what needs your son might be trying to express when he speaks this way. Has his day been overscheduled? Is he tired or hungry? When my GS comes across this way, I usually smile, look him in the eye, and ask him gently to "try that again, please!" He comes through like a champ. And then I address whatever issues/needs he may be expressing.
It also helps to notice out loud when he's using a polite voice. Kids love to be acknowledged when they're making an effort, and usually respond by doing more of it.