Hi anfal
Thanks for reaching out to Microsoft Qn A
You can detach a payment method only after you settle all previous charges for a billing profile. If you're in an active billing period, you must wait until the end of the billing period to detach your payment method. Ensure that you meet all other detach conditions while you wait for your billing period to end.
Kindly follow this document for all detailed steps : https://learn.microsoft.com/en-us/azure/cost-management-billing/manage/change-credit-card
In case you still face issue while detaching card, kindly reach out to support team- create a support request.
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.