Display manager Updated +Created
Check which you you have:
systemctl status display-manager.service
Tested on Ubuntu 23.10 I see:
● gdm.service - GNOME Display Manager
     Loaded: loaded (/lib/systemd/system/gdm.service; static)
     Active: active (running) since Sun 2023-12-24 10:34:50 GMT; 23min ago
    Process: 1827 ExecStartPre=/usr/share/gdm/generate-config (code=exited, status=0/SUCCESS)
   Main PID: 1850 (gdm3)
      Tasks: 4 (limit: 71817)
     Memory: 6.8M
        CPU: 119ms
     CGroup: /system.slice/gdm.service
             └─1850 /usr/sbin/gdm3
which means I have GNOME Display Manager.
Unable to lock screen on Ubuntu Updated +Created
Happened on P14s on Ubuntu 23.10, which started with fresh Ubuntu 23.10 install.
However it did not happen on Lenovo ThinkPad P51 (2017) also on Ubuntu 23.10 which had been upgraded several times from God knows what starting point... At first one had X11 (forced by Nvidia drivers) and the other Wayland, but moving to p14s X11 changed nothing.
Both were running GNOME Display Manager.
Same happens with Super + L, but also CLI commands: askubuntu.com/questions/7776/how-do-i-lock-the-desktop-screen-via-command-line