See if you have saved the theme in products or categories.
In product attribute group 'Schedule Design Update',
attribute New Theme, attribute code
Also check categories attribute 'Custom Design', attribute code
You need to update the products and categories data for this attribute in database.
`SELECT * FROM eav_attribute WHERE attribute_code = "custom_design";`
There are 2 entries, 1 from product and 1 from category.
`SELECT * from catalog_product_entity_varchar WHERE attribute_id = product custom design attribute id ;`
`SELECT * from catalog_category_entity_varchar WHERE attribute_id = category custom design attribute id ;`
Most likely you didn't set on purpose the Schedule Design on products.
You can delete the entries in
catalog_product_entity_varchar on attribute id custom_layout.
The same to
Or update with empty string/null in these 2 tables. Or set the new theme id, if you set those values on purpose.
Usually the theme id is in products or categories because product imports or other mass action.
Last, reindex all and flush cache.
Also, widgets can have the theme id set.
SELECT theme_id FROM widget_instance;
Check 'design_*' tables too.
An extra thing to do would be to dump the structure of the database and search on word 'theme'.