Anyone wanting to compile lxd for debian should begin by reading the debian trackre showing five years of effort at packaging LXD in deb format. in particular this message that shows the best LXD expert dismissing at futile efforts at packaging anything beyond the LTS release.
Then the most recent messages show that recent LXD (not LTS, that is > 3.0x) use packaged versions of ZFS, BTRFS, SQLITE. So anyone wanting to compile LXD > 3.0x should either know very well the innards of SQLITE, ZFS or BTRFS, so that they know if and when they can use their own system version with LXD, or take the Ubuntu patches and compile these libraries to the same level as the compiled LXD version. If not they are using an untested configuration.
So in a few words: good luck ! I am not good enough to help you, sorry.
Edit: I said ‘ubuntu patches’, but the appropriate word is ‘snap lxd patches’