FIXED THE LITTLE BEGGAR!
I have had this problem for several weeks on a Dell XPS desktop. What was particularly annoying was that I have a second older desktop computer running Windows 10, which I use at the same time as the Dell. This second computer was running without problems and since it has had the same windows updates as the Dell, that seemed to rule updates out as the culprit. I tried faffing around with power settings which of course made no difference, nor did flashing the bios. I was looking at Task Manager about an unrelated matter and clicked on the Services tab. There, sitting almost at the top of the list, was an entry called "Adaptive Sleep Service". Ahaa thinks I, could this be it! At the bottom of the services tab I clicked on "Open Services" (you will need to be logged on as Administrator) and the "Services (local)" list opened. I noted that the description was AMD Adaptive Sleep Service which meant it was to do with my video card. I right clicked on Adaptive Sleep Service, clicked on Properties, hit the drop down box for startup type and selected "Disabled". Voila - fixed - no more shutting down when sleeping!
Hope this might help others