I’m gonna guess that the reason this doesn’t work is that when the docker snap runs inside the lxd container, it is running under the lxd child profile, and that is denying the dockerd daemon from doing something. Do you see any denials or other suspicious message in the system journal either inside the lxd container or on the host?
Jan 06 21:55:39 first docker.dockerd[2635]: time="2020-01-06T21:55:39.075482785Z" level=error msg="stream copy error: reading from a closed fifo"
Jan 06 21:55:39 first docker.dockerd[2635]: time="2020-01-06T21:55:39.286016285Z" level=error msg="cc56640421adba74753190df922c446a226e28c7e083f7193782a5c0a0f25282 cleanup: failed to delete container from containerd: no such container"