In order for an external instance definition to be deleted there can be no active references to it.
All cross instance dependencies between the two instances must be removed before the instance definition can be deleted.
Example: 2 instance: QA1 and QA2
Run "autorep -X ALL"
This will confirm which external AutoSys instances QA1 has been configured to communicate with.
NOTE - The Assumption is we see QA2 and possibly others.
Run "autorep -q -J ALL > /tmp/alljobs-QA1.out"
then search the alljobs-QA1.out file for the external instance name(s) you are trying to break the communication with.
You would either delete the jobs with the cross instance reference completely or modify their conditions, removing the reference to the QA2 instance.
(see jil syntax for delete_job and update_job).
Repeat all the steps above in the other external instance(s).
In the above example that would be QA2
Once the above has been completed you may remove the external instance definition(s) without issues.