As noted in discussions with @andy - the globalIndex gather uses procIDs, but these are the subranks (in the parent), not the actual ranks for the communicator.
@Mattijs