lxc client needs access to the LXD Unix socket.
Run the following. Here, the group is lxd, and has
rw- access to the socket.
$ ls -l /var/snap/lxd/common/lxd/unix.socket
srw-rw---- 1 root lxd 0 Jan 23 20:24 /var/snap/lxd/common/lxd/unix.socket
Therefore, if you get again Permission denied, please post both the output of groups and ls -l /var/snap/lxd/common/lxd/unix.socket.
Regarding the removal and reinstallation of LXD, as a snap package. If you use a loop file for the storage of the containers, then I think the removal of the snap package would remove the loop file as well. But if you use a dedicated partition or disk, then these are not removed.
There is no purging with snap packages.
Regarding the IPv4 IP addresses, I can guess that the port 53 was not freed when you initially removed the snap package, so when you installed again,
dnsmasq from LXD could not start. At this point, this is a theory. If you are OK to reinstall, can you please reboot before installing LXD again?