duplicate of Publish/Unpublish Error
Have you tried to perform re-indexing as suggested in above thread?
If re-indexing doesn’t help, you might need to upgrade DB via migration, see:
(above setups are mostly used to transfer data between different databases but can also be used for same database in case upgrades to different versions)