Changing the server file mtime worked after all - it just took some time for it to sort itself out. I used the script at https://help.nextcloud.com/t/client-desktop-mac-change-date-to-01-01-1970-after-download/129765/9?u=3mu, but had to modify the IFS line:
#!/bin/sh
OIFS=“$IFS”
IFS=$’
’FILES=$( find . -type f ! -newermt “1971-01-01” )
for FILE in $FILES; do
NEWTIME=$( stat -c %z "$FILE" ) echo "Setting '$FILE' to '$NEWTIME'" # touch -m --date="$NEWTIME" "$FILE" # Comment to test
done
then run
sudo nextcloud.occ files:scan --all