Follow the below steps on how to correct the unlinking of Sales Order and Invoice:
1. Open the Invoice
2. Hit Edit > Actions > Delete
3. Edit the Sales Order indicating the correct customer name
4. Save the Sales Order
5. Then create a new invoice from Sales Order to associate the invoice by clicking the Bill button.