Sorry for asking the usual: check the health of your database and then perform the repair procedure anyway
I not sure if you can use this on QNAP, but it’s conceivable: Suggested SQLite3 DB Optimizations - #69 by ChuckPa
Further resources: Qnap faq.....read me first! and https://support.plex.tv/articles/repair-a-corrupted-database/