If an alert states "You may not delete a deposit transaction for a recorded sale."
You'll see this alert message when you try to delete a payment if you've entered the payment on an order and then converted the order to an invoice.
If you need to remove a payment entered in this way, use the procedure To delete an invoice with a deposit applied.