If removing manually memories tables fails, I would try removing them within mariadb (via CLI or phpmyadmin).
mysql -u root
# MariaDB shell
CREATE DATABASE remove_memories;
EXIT;
# bash shell
mysql -u root remove_memories < apps/nextcloud/backup/db.sql # import in new created remove_memories db
mysql -u root
# mariaDB shell
USE remove_memories;
SHOW TABLES;
DROP TABLE IF EXISTS oc_memories... # all the memories tables...?
EXIT;
# bash shell
mysqldump -u root remove_memories > /home/yunohost.backup/archives/apps/nextcloud/backup/db.sql # if db.sql was extracted inj this folder
Then update the archive and restore it.
Finally remove remove_memories db.
# badsh shell
mysql -u root
# bash mariaDB
SHOW DATABASES;
DROP DATABASE remove_memories; # be careful...
EXIT;