Instead of cancelling a debit document (invoice), you can balance it with a credit document (credit note).
There is an additional step to balance already paid documents.
Ensure you select a credit document type
1- Ensure the reference document is linked
You can leave all fields as suggested.
Choose the help button to get more info about the finalize window.
The document should be marked as paid.