Because I manually installed on my own existing PI installation and I didn't want to install Octoprint as a service (so no need for sudo/superuser privileges).
It's strange that the command only half works in that it shuts down but doesn't restart.
Yet, it works from the command line so shouldn't be a permission issue...
Here is the relevant portion of the octoprint log file when I trigger shutdown from the Octoprint web interface:
2022-04-28 22:06:25,172 - octoprint.server.api.system - INFO - Performing command for core:restart: ~/octoprint/venv/bin/octoprint daemon restart
2022-04-28 22:06:26,040 - octoprint.server - INFO - Shutting down...
2022-04-28 22:06:26,646 - octoprint.server - INFO - Calling on_shutdown on plugins
2022-04-28 22:06:26,647 - octoprint.events - INFO - Processing shutdown event, this will be our last event
2022-04-28 22:06:26,649 - octoprint.events - INFO - Event loop shut down
2022-04-28 22:06:26,663 - octoprint.plugins.HeaterTimeout - INFO - Shutting down...
2022-04-28 22:06:26,665 - octoprint.server - INFO - Cleaning up daemon pidfile
2022-04-28 22:06:26,665 - octoprint.server - INFO - Goodbye!
So you can see that the command is sent and processed but only the shutdown occurs...
In contrast, when I issue the command from the CLI I get:
2022-04-28 22:07:54,771 - octoprint.server - INFO - Shutting down...
2022-04-28 22:07:54,826 - octoprint.server - INFO - Calling on_shutdown on plugins
2022-04-28 22:07:54,827 - octoprint.events - INFO - Processing shutdown event, this will be our last event
2022-04-28 22:07:54,828 - octoprint.events - INFO - Event loop shut down
2022-04-28 22:07:54,842 - octoprint.plugins.HeaterTimeout - INFO - Shutting down...
2022-04-28 22:07:54,843 - octoprint.server - INFO - Cleaning up daemon pidfile
2022-04-28 22:07:54,844 - octoprint.server - INFO - Goodbye!
2022-04-28 22:07:55,233 - octoprint.startup - INFO - ******************************************************************************
2022-04-28 22:07:55,235 - octoprint.startup - INFO - Starting OctoPrint 1.7.3
2022-04-28 22:07:55,236 - octoprint.startup - INFO - ******************************************************************************
2022-04-28 22:07:55,543 - octoprint.util.connectivity.connectivity_checker - INFO - Connectivity changed from offline to online
2022-04-28 22:07:55,576 - octoprint.util.connectivity.connectivity_checker - INFO - Connectivity state is currently: online
2022-04-28 22:07:55,577 - octoprint.util.connectivity.connectivity_checker - INFO - Connecting to 1.1.1.1:53 is working
2022-04-28 22:07:55,577 - octoprint.util.connectivity.connectivity_checker - INFO - Resolving octoprint.org is working
etc.
So that the restart follows the shutdown...