If a program's OrgUnit field has only a local value (its "remote" part is empty), program.getRemoteOrgUnits() return a List with a single empty value, instead of returning an empty list.
The program synchronization fails when it calls this method, and tries to resolve the empty ID in the list.