I got my Dell G5 15 5590 about two months ago. Whenever I close the lid, there seems to be a 75% chance the laptop will turn itself off. I've checked my options about closing the lid, and for all the options its set to sleep, so I don't see why it's doing this. I suppose the battery could be faulty, but I'm not sure how I can test this. This also happens when the laptop is plugged in/charging.
Not a huge problem, but just wondering if anyone had any ideas.
The only time I've seen consistent behaviour in laptops when shutting the lid is when they are set to "do nothing" when shutting the lid. I've always noticed that sleep mode is inconsistent - sometimes it sleeps and sometimes it doesn't, seems to depend on battery percentage - if you've got lots of battery then sleep tends to work (although if you leave it for a long time - a few days, then it sometimes doesn't recover). If you've not got much battery, sleep tends to default to shutting down instead, from my experience.
Hope that is useful information - although I'm aware probably not helpful as to what you want to achieve!
Thanks for posting. Apologies that your system is not performing as expected.
New computers come with Modern Standby rather than the traditional sleep mode we've grown accustomed to for years. Here is information regarding Modern Standby you find interesting: https://dell.to/2MQy979