In general, getting a database update error, I did the following, found the pamac.conf and pamac.conf.pacnew files, opened the first one in the editor, copied everything that was in the second. Saved, reloaded, the error disappeared. Flatpak and the old repository were registered in the first file, which is why there was an error (in my opinion), now everything is fine. Perhaps it will be useful!