Macbook Air 2020 restarts when I close the lid
When I close my Macbook Air and then reopen it some time later, I usually find that it has shut down or at least tried to shut down. Often I see a popup that says the Mac couldn't shut down because Word or Excel or some other application couldn't shut down due to an unsaved file. Options are save, don't save, or cancel, and I always hit cancel. Then the apps that have already shut down have to start up, while I wait. Sometimes the popup doesn't appear, but all of the apps begin to restart. Time consuming and annoying. I don't think I lose data, since it doesn't shut down if files are unsaved, but I often lose the Chrome windows that were open before I shut the lid. This used to happen almost every time but then the frequency decreased until I updated to OS 13.4.1 recently, and now it happens almost every time I close the Mac for more than a few minutes.
Mac mini, OS X 10.11