Empty folders not deleted, 'rm' command errors and occasional deletion of folders with files during backups

  1. Try changing --vfs-cache-mode writes to --vfs-cache-mode full.

  2. Mega support in rclone is slow and not well maintained (so can be buggy). Try using official megacmd client as a webdav server mounted via rclone. You will find many examples on this forum, e.g.: