How to get rid of a DM in AP that was used to cancel out a debit

I have created a “cancellation Invoice” to cancel a debit however because it was Automatic with drawl it did not cancel out the invoice and now the DM is is sitting there and it will not allow me to apply it as it keeps saying it was used towards the invoice it was cancelled to. Does anyone know how I can get rid of this DM?

We have had this happen a few times its very irritating that a cancellation invoice can’t be applied to any open invoice.
Our solution is to make an adjustment on both
-Accounts Payable/General Ops/Adjustment
Pick up the Invoice and enter the adjustment to reduce the balance by the amount of the Debit Memo select a GL ledger (we use suspense)
Save then select the Debit Memo reduce the balance by the same amount select the same GL ledger and apply date.
Both transactions should now be cleared and your ledger should have a debit and credit that clear each other