This error happens in SQLite sometimes, and the Internet has various ideas on how one can sometimes dump the broken database (assuming it cooperates…) and put its contents into a replacement database.
SQLiteException “database disk image is malformed” is one example, but really it appears case-by-case.
Database disk image is malformed is a case where a quite-database-savvy user managed to fix theirs up.
Another option is to Recreate the database after deleting the bad one (preferably saving off a copy first…). There have been reports that it’s faster to start again, but then you lose the ability to restore older versions.