I believe you messed up your environment by installing/uninstalling snaps and debs. I suggest to remove everything (danger zone - it will wipe also postgres and your databases) with
sudo DEBIAN_FRONTEND=noninteractive apt remove --purge -y 'maas*' 'postgresql*' && sudo DEBIAN_FRONTEND=noninteractive apt -y autoremove
sudo snap remove --purge maas
and start from scratch