You're right. Maybe we need a last document customer change option as most such errors are realised the moment we hit the enter button!
There are many ways an invoice can be entered. The most common place such an error would arise is in a Direct Invoice entry or in a Sales Order Entry since that is where a Customer is chosen and everywhere else it gets carried over from the parent document, we need to have:
1. Change Last Invoice Customer
2. Change Last Sales Order Customer
It should address the wrong defaults for address and other contacts and references that may have been entered.
... provided no payments / credit/debit notes have been made in the meanwhile!
If the said invoice/sales order got emailed to the wrong customer entered ......
There is an Invoice edit option ......