i had the same issue , but mine is more complicated than yours , it started to happen when i changed the harddrive with a new one , but only a matter of week my laptop started shutting off and restarting (ps : my laptop is 4 yo) , at first it started while in a game , and then it became randomely , i took it to a computing care store and they said that my GPU is dying , but i had no symptons of a dying GPU as the internet said ( i checked many forums), but after a month of no use i decided to use again it on AC + battery , since then i had almost no shutting off (like once per week which is nothing compared to what it was before lol) , but tonight i smashed a key hard enough to shut the laptop down
, and here we go again the same thing came back which led me to post this reply seeking for a final help because i had enough and lost hope in reparing it ...
PS : no blue screen of death ever existed in my case , but someday it showed me while in booting that i had PXE error , please check your connections or something like that.