First and foremost, keep your back up current. If you end up having to send it in do one final back up then restore to factory defaults. With laptops the first thing I do when I get them home is clone the original drive to whats pretty much always a larger and better drive than OEM. Then I take the original and put it away for safe keeping. This way if I have to send it in all I have to do is pop the OEM drve back in.
If this happens when the laptop is cold its not heat related. I do on a monthly basis remove access covers and blow compressed air into the vents, like a back flush to clean out the heat sinks. Every 6 months or so pop it open and inspect and clean as necessary.
Is your BIOS current?
My best guess is only a few things.
BIOS related or even weak CMOS battery which is a PITA to change, most models the battery is installed as such as the entire MOBO has to come out aka total teardown! Had to do it on my G752VY when I tried to use the intel app to jack my dram higher, this is when I found out that no matter what the dram says it can to it limited to 2400MHz. I moved the battery to where its accessible from the service cover.
Charging circuit inside the laptop could have a bad steering diode that starts working correctly once it conducts.
My primary concern though would be the battery. Im guessing you are at about the 2 year mark with the machine. Batteries longevity depends on use. Check your battery health as follows
Hit Windows Button + X and select Command Prompt (Admin). This is the quickest way to open the Command Prompt as an administrator.
Type in and enter: powercfg /batteryreport.
Open the Battery report HTML file to view it.
Its towards the bottom if I remember right. Tells you the design capacity and current state.
Even if this shows as good it could still be a battery. It only takes one cell to crap out. It can be not conducting and not provide current then when the charger comes up and charge current hits it it begins to conduct. After its warm and has been conducting for awhile its as if nothing happened. It can also be hit or miss where it doesn't happen all the time. Batteries are strange this way. Recently on my wife's Jeep wouldn't start, fairly new glass mat battery. The last thing you normally do it turn on more devices like headlights blowers etc right? Well in this instance it actually made it work as if nothing was wrong. I scratched my head on that one for some time. Eventually when trying it the next day after she got stranded close to home I heard a distinctive sound. POW!!! as the side of the battery casing blew out and the smell of rotten eggs fills the cabin. Yanked battery and went to parts store where I bought it (10 years 100% replacement) the nimrod breaks out a battery load tester. Im like dude, look a the battery, the side is GONE!

“Two things are infinite: the universe and human stupidity, I'm not sure about the former” ~ Albert Einstein