There should’t be a disconnection related to LXD. Being macvlan, the networking should be transparent and not affected in any way by LXD.
Have a look at
any DB logs in the container. Also, add debug logs.
trying to figure out when you get those disconnects, then use tcpdump or tshark to capture the network packets. You should be able to capture the network traffic of the disconnection and probably find who is at fault.