Show debug console was what helped me. If I remember correctly it was some warning with ssao (screen space ambient occlusion)
So I went through each setting I had in graphics and disabled it until I found what was giving me this warning.
I am so sorry, I was meaning to post an update sooner on what I did to solve my issue sooner so the details were fresher in my memory but I didn't.
But enabling show debug console was what helped me figure out what was causing my game to randomly freeze when going afk.
I hope this helps any future readers here!