Let me help you account the payment and deposit properly in QuickBooks Online.
To properly account the transactions, you can use the journal entry and link it to the invoice.
Select the Plus icon (+) on the Toolbar.
Under Other, select Journal Entry.
Enter the transaction date in the Journal date field.
On the first distribution line, in the Accounts field, enter any account listed in the Chart of Accounts.
Note: If you are not sure which account receives the debit and the credit side of a transaction, consult your accounting professional for guidance.
Enter the transaction amount in the Debits or Credits column. Tip: The first line is typically a Debit. Once you save the transaction, you can find it in the Recent Transactions report to see whether the Debit entry had the desired effect.
Specify a customer, vendor/vendor, or employee associated with the line, if any, in the Name field. Note: QuickBooks Online Plus users – When the Classes and Locations feature is turned on, additional fields for Location and Class appear.
Continue to enter distribution lines until the sum of the Debit column entries equals the sum of the Credit column entries. Note: QuickBooks Online Plus users – When the Classes and Locations feature is turned on, additional fields for Location and Class appear.
From what I understood from your description, first invoice (I assume your customer was invoiced, correct me if that is not so) was paid by mistake and then refunded and then another invoice was sent to another customer. In that case you would need to record following transactions: Invoice for customer 1-> Payment for this invoice->Refund Receipt for the whole amount -> Invoice to Customer 2-> Payment for this Invoice.
If the first payment is a billable transaction, then the flow would be different.
How do I properly account for a payment that was made & deposited then later refunded and paid by another person with out throwing the bank deposit out of balance
Journal entries should be the exception when using QB, they often do not work as you think they should, and when you use inventory type items they never work for inventory. It is much better to use the forms on the home page the way QB is designed to be used. Journal entries also bypass accrual/cash reporting, and will not show on many reports.
Why intuit recommends them is a mystery to me.
Issue the refund payment and use a clearing expense account as the expense for the payment
make a deposit for the amount received, use the same clearing expense account as the source account for the deposit.