SU hangs on lxc container

Since a couple of days I’m experiencing a weird issue with newly (created) launched lxc containers.
My host is ubuntu jammy and the lxd snap version is 5.18-da72b8b.
When I launch/create a new container based on ubuntu:22.04 or ubuntu:23.04 images with a default configuration and a btrfs storage pool shared by all of my containers, I can access the new container successfully as a privileged user, i.e. lxc exec orbis -- /bin/bash.
However, when I try to access the newly created container as unprivileged user, lxc exec orbis -- sudo --user ubuntu --login it simply hangs.
The same happens if I first access the container as root and then I try to do su ubuntu.
At this point the shell hangs again.
I checked the lxd log and there are no anomalies,
I checked for groups settings for the ubuntu user in the newly created containers and they are the same of a container I created a few weeks ago with the same configuration.
On existing containers there is no problem so as a last resort, I created a new local image from the snapshot of a working container, and the new container works as expected, i.e. it allows access from an unprivileged account.
Any hints on were to look to diagnose this frustrating issue?