To avoid duplicate deposits in QuickBooks, We need to delete the deposits. Here you can get the complete guide on how to delete a deposit in quickbooks.

https://errorgenie.com/quickbooks/how-to-delete-a-deposit-in-quickbooks-and-deposit-from-payment/