This has happened again overnight. From looking at the output of pmset -g logs and the install.log file, I think that my MacBook is actually sleeping:
2023-10-13 22:24:04+13 Noels-MacBook-Pro softwareupdated[524]: SUOSUPowerEventObserver: System will sleep
2023-10-13 22:24:04+13 Noels-MacBook-Pro SoftwareUpdateNotificationManager[960]: SUOSUPowerEventObserver: System will sleep
2023-10-14 09:46:29+13 Noels-MacBook-Pro SoftwareUpdateNotificationManager[960]: SUOSUPowerEventObserver: System will power on
2023-10-14 09:46:29+13 Noels-MacBook-Pro softwareupdated[524]: SUOSUPowerEventObserver: System will power on
This clearly shows the laptop going to sleep in the night and then waking up in the morning.
But for some reason the screen is never locked even though the settings clearly state that it should be.