I found this solution on Tom's Hardware seems to work for me (because I set my Ryzen to full performance and the option was automatically turned off): Go into power options and changed "Link State Power Management" to OFF. Its under PCI Express in Control Panel.
My PC would restart when the monitor goes into sleep mode OR if I remove the HDMI or Display Port cable.