Are you dong everything according to the guide?
Is the machine x64. I run an arm64 myself and it is possible. But maybe some dependencies are missing? Backups will not work out of the box for arm64. But this has nothing to do with contacts.
did you run:
sudo apt update
sudo apt upgrade
You can comment out nextcloud install in start.sh
in /home/YOURUSER/mailinabox/setup
Installating without Nextcloud - Help with Setup/Upgrade - Mail-in-a-Box Forum (mailinabox.email)
Find the right line to skip nextcloud and investigate further. source setup/nextcloud.sh
Run nextcloud.sh afterwards see what happens.
Try running it also with sudo su
I have no idea why this is happening it has been documented before here
and there is no response from anybody else.