I am getting the following error when I try to merge 2 territories "Cannot proceed. There are records with missing territories. Please call support.".
I have checked all the tables that there are no missing territories but still the message appears.
Search in CRM logs folder where “ewareterritoryerrors” log file will be generated. If you check that file you can find which records are causing issues. In my case, there are opportunities with territory id that does not exists in the Territories table.