From an eXist list posting:
The error damages the indexes. To recover from it, you would need to
stop the db, remove all .log and .dbx files except dom.dbx, symbols.dbx
and collections.dbx, restart the db and use the Java admin client to
reindex everything.