Thanks for reaching out to the QuickBooks Community. I hope your day is going great so far.
To clarify, what application error are you receiving? Could you provide a screenshot of it? Any additional details you can share will be a great help in providing you with the right steps.
Please remember that when you change the customer name on an invoice, the payment will automatically be unlinked from the invoice. This will make the invoice appear open and unpaid. The unlinked payment will create a credit for the customer.
For more details about the above process, consider checking out these articles: