Hello. I had this problem. In my case, the error message was in Spanish: “No se puede sincronizar debido a una hora de modificación no válida”.
I solved this in the same way as @inalto:
find . -type f -newermt "1969-01-01" ! -newermt "1971-01-01" -print0 |xargs -0 touch
However, my Nextcloud was installed via snap, so the command for scanning all files was different:
sudo snap run nextcloud.occ files:scan --all
In my case, it took 2 minutes for about 7 GB of data.
Thank you and greetings!