As far as my experience is concerned, this error means that your database is referring to theme which is not present. To make sure run the following commands
select distinct themeid from layout;
select distinct themeid from layoutset;
Now go to liferay’s Control Panel -> Plugin Configuration -> Theme Plugins tab and click on the theme in question. See the
Plugin ID of the theme. It should match what is there in layout and layoutset tables. If it doesn’t then you have to either change themeid or update database tables. If you happen to update DB don’t forget to restart or clear DB cache.