PC goes into sleep mode immediately regardless of the settings
so test this with your device, if this is the issue, it will happen again if the device touches or reaches to the laptop. keeping a distance of the device may help to stop the laptop going to sleep automatically. 2. The old Battery: If you laptop has an old / dead battery, the system do this automatic sleep but pressing the power button again