Payments associated with refunds cannot be deleted

I want to unallocate a payment but can’t as I get this message

“Payments associated with refunds cannot be deleted”

How do I make it so I can unallocate

You’d need to first locate the refund and delete that, this will unlock this underlying payment and allow you to untag or remove.