Another reason for this error could be the entity is not listed in the AppDatabase.java file:
@Database(entities = {XEntity.class, YEntity.class, ZEntity.class},
version = 1, exportSchema = true)
Make sure you have the latest db file in the databases folder, and if you export your schema, make sure your .json schema file under app\schemas is being properly updated.