If you are encountering the "Account has unpaid invoices. Please pay them before removing your card." error message it likely means you are in the Billing area and attempting to use the "Remove card" option while your organization still has one or more active databases.
Or, you may have recently deleted those databases already but there is a balance within the current month's invoice for the charges that accumulated prior to the deletions.
The first step here is to ensure that you have deleted all existing databases within the organization first.
Afterward, if there is a pending balance within the current month that amount may be paid early via the organization's Settings area.
On the organization Settings page, scroll down to the "Delete organization" section and expand the "View checklist" area. If the steps shown there have been completed already you should see a button provided allowing you to pay for any pending charges right away rather than waiting until the end of the month when invoices are automatically processed.
Once payment has been completed, you should be able to proceed back to the Billing area and be able to use the "Remove card" option successfully!