Out of sync and cannot move, delete, or rename folders in Nextcloud

Have you tried removing locks?
On your server:

  1. take a backup of your database
  2. take your server into maintenance mode
  3. remove locks, if you’re running MySQL in MySQL DELETE FROM oc_file_locks WHERE 1 ;
  4. Turn maintenance mode off.

If you’re not running a redis on your server, I would set it up. It might make your life easier.