For anyone encountering this error, the solution is to find the products listed in the three ‘aggregated bestsellers’ tables that are no longer in your catalog and delete them.
The SQL to do it is:
DELETE FROM `sales_bestsellers_aggregated_yearly`
WHERE `product_id` NOT
IN (SELECT `entity_id`
...and then running twice more, replacing ‘yearly’ in the table name with ‘monthly’ and ‘daily’ respectively.
If you want to play it safe, replace the ‘DELETE’ statement with a ‘SELECT’ statement, run in phpMyAdmin, and then check all the records that show up and delete them.
You might lose a bit of bestseller data for your older products, but on the other hand, you should be able to go live on 22.214.171.124!
EDIT: I’ve just noticed my error was slightly different to Sean’s - same .php file; different tables. Still, hope this helps someone.