Hi FSQ, welcome to the Crunch Chorus Community Forum!
Invoices are legal documents and need to have a consecutive numbering system, so - as per HMRC’s rules - you can’t delete or edit an invoice once it has been issued. You’re right, the best bet is to raise a credit note against the relevant invoice to write it off.
A credit note can be raised for the full amount of an incorrect invoice, and then another invoice issued to correct any mistakes or make any edits.
Hope this answers the question for you!