I have the exact same problem.
I found the cause but I do not know how to fix it.
So far, I get this "random shutdown" when I am playing stressful videogames that push my power consumption to the limits.
As soon as I plug my gaming keyboard, mouse and headset, my laptop will shutdown under load.
Playing a light game such as older games with less demanding ressources, with all the gaming gears plugued in, I have no issues.
If I unplug all my gaming gears then the laptop run the heavy load games without a itch.
I tried to plug everything in a powered USB3 hub (with a 5A adapter, which should be WAY more than what needed for 3 devices) my laptop still shutdown.
My laptop is by no way overheating, it's also seating on a good laptop cooler which keep the laptop cool and steady.
Is this related to the power supply / battery drain issue or not I am not sure.