Ubuntu deprecated unprivileged kernel namespaces by default as of 24.04. There is not a workaround for this on the software side.
You can read more about the change on the Ubuntu release in the security section:
It’s more likely we’ll update the documentation on how to add a AppArmor profile to Ubuntu or disable it completely (easy but please don’t do this). I know some distros (Mint, specifically) already rolled back this change.