Here you can’t reinstall it beacause the folder /home/yunohost.app/nextcloud/data is still here
2025-02-23 11:20:13,113: DEBUG - Login is invalid because files already exist for this user
Have you keep a backup of the previous nextcloud ?? Is better restore a backup.
Or if no backups, you can rename the folder with the data, install a new fresh nextcloud and try move files of the users folders, but like this only files will be saved…
All commands are connected on ssh and with root user
Once connected to a shell to get root shell
sudo -i
Then these steps
Rename the data folder
mv /home/yunohost.app/nextcloud/data data-BKP
Install nextcloud
yunohost app install nextcloud
Give correct permissions on the backup folder
chown -R nextcloud: data-BKP
Copy files for user from backup to new folder data => user => files
cp -a data-BKP/user/files/. /home/yunohost.app/nextcloud/data/user/files/
Rescan the folder needed for the database
yunohost app shell nextcloud
php occ files:scan user