Hi ,
I understand that Razer Cortex is probably optimized and when you are in the game it activates Game Turbo mode and in this mode it deactivates processes and services that it considers unnecessary and when you close the game it returns to normal mode at that moment that causes the crash I was already thinking that you had Iobit Game Booster some users had reported some problems but this with Ryzen this must be the problem
One thing is that if you updated the motherboard without formatting Windows may have problems with the drivers in the future it is always good to do a clean installation to update hardware in the motherboard and processor issue.
I am glad that you found the smart problem that is a definitive solution.
Hope this helps.
If you find the answer helpful, please mark it as an answer.
Independent Advisor - Community
Thanks