In this situation, you may have selected the wrong Vendor record for the items being sent back (this would require two similar vendors with the same address, or for the first vendor to forward the items to the second vendor). The suggested method for handling this would depend on how the items are to be disposed (how the vendor return is to be closed).
If you are returning replacement items to stock, or writing them off, the error is not too drastic as the items can be returned or written off and the vendor name is not critical for these transaction types.
If you are receiving a credit from the vendor, you could update the Vendor in the Pending records to the new company using the Assign Tagged Items to Vendor option (before the items are used to create a vendor invoice). Or you could create the AP invoice on the first vendors account and then Assign it to the correct Vendor to get the credit on the correct account. AP Invoice Assignment is discussed in detail in the documentation for the Accounts Payable System.