Windows is configured by default to automatically restart when a 'system failure' occurs. If a 'system failure' occurs during the shutdown process then Windows will automatically restart - that's what you're seeing.
You could turn off the auto restart function, but that just masks the problem, it doesn't solve it.
Something is not closing properly when Windows sends the shutdown signal and it's almost certainly a third party product. Before you shutdown, open Task Manager, click the Process tab (it's usually the default) and manually end every non-essential (third-party) process. Things like Corsair iCue, Dropbox, printer tools, and all other third-party stuff that's running and which you don't need (at shutdown time). Then shutdown and if WIndows doesn't automatically restart then you'll know that it's one of those third party processes that was failing at shutdown. Then it becomes a process of elimination.