During troubleshooting we clarified that the computer was not shutting down; the login window appeared immediately if she pressed the power button gently instead of holding it down. She also allowed that the unexpected sleep was not only at login, but could happen any time if she got past the login window. And she could work around the problem by using a USB keyboard.
The culprit was a magnetic bracelet that she wore only occasionally. First thing in the morning she would try to log in to the laptop, without the USB keyboard, and her wrist got close enough to trigger the sleep-when-lid-closed setting. I heard the bracelet jangle on the phone, and guessed correctly that it might be a magnet.
This was my second encounter with this problem. The first time was when a laptop on my workbench died unexpectedly during troubleshooting and would not start up. It was stacked on top of another of the same model, and the lid of the laptop underneath was triggering sleep-on-closed-lid setting of the laptop on top.
Fast forward to a few weeks ago. I diagnosed a similar problem in 5 seconds while walking through the office. Laptop sleep was being triggered by an employee's new Apple watch.
It might take hours or days to figure out a problem the first time you encounter it. The second time is a memory test. The third time you look like a genius.