Usually this happens if RB is launched during the sync or maybe the RB agent was doing something in the background.
First thing to try is to start RB, close it and try the sync again
If that doesn’t work, best to restore the RB database backup that Lexicon makes, see Backups and how to restore them under the Rekordbox chapter.