Limits.cpu limit not working?

The containers do not have a full view of the hardware of the host, and whatever view they have, is controlled by LXCFS. It is up to what is supported currently by LXCFS, whether a container sees the full number of the cores, or a reduced number.

Here is the latest release of LXCFS, along with the list of changes,

You can see that in the recent changes, there is even better virtualization support for /proc/cpuinfo and other resources in /proc.

But which version of LXCFS does your LXD installation have?
If it is the snap (3.16), here is the command to check the version. If using the deb package, adapt the pathname accordingly.

/snap/lxd/current/bin/lxcfs --version
3.1.2

You are reporting that on LXD 2.0, the container sees only the number of CPUs that you have set in limits.cpus. I verify that the same happens in LXD 3.16, therefore this feature (viewing the number of cores in /proc/cpuinfo) has been supported since at least LXD 2.0.

Apparently, in the case of ArchLinux and the packaging of LXD, the lxcfs package is likely recommended (not required), hence the users should manually check that it gets installed.