It's a failing that I need to pre-empt every situation where I don't want the machine to sleep and run a tool to prevent it from sleeping, when I could usually just say 'don't sleep when I shut the lid'.
The exceptions are really narrow. E.g. if you want your SSH sessions to stay alive, you also need to ensure that you never leave the WiFi coverage.