It sounds like you had outstanding payments dues on a previous purchase.
Deleting an app does not refund the money. You have to ask for that and then wait for it to be returned if Apple decides to do that.
Read this article to learn how to request a refund for apps or content that you bought from Apple --> Request a refund for apps or content that you bought from Apple - Apple Support
Read this support article for information about how long it takes to receive a refund, and how to check the status of a refund for apps or content that you bought from Apple --> Check the status of a refund for apps or content that you bought from Apple - Apple Support
After you request a refund you'll receive a status update by email within 48 hours. If your refund is approved, the funds are applied to the same payment method that you used to buy the item. How long it takes for a refund to appear on your account or statement depends upon the payment method used:
● Store credit—It might take up to 48 hours to see the refund in your Apple Account balance.
● Mobile phone billing—It might take up to 60 days for the statement to show the refund. Processing time might be affected by your carrier. You can contact your carrier for an update.
● All other payment methods [e.g., credit or debit cards]—It might take up to 30 days for the statement to show the refund. If you don't see the refund after 30 days, contact your financial institution."
Since the article specifically says "statement", which for me is the thing that arrives monthly in my mailbox, I wonder if you check your daily card transactions if you might see it earlier?
For apps and media you can also sign into https://reportaproblem.apple.com to check if the status of your item is "Refunded".
Apple's official support articles team currently presents multiple statements about requiring the presence of a payment method at times, even for free items. If you are encountering one of those situations then based on the documents I suspect you have no option but to enter a valid payment method if you wish to continue downloading. Read the support article Add a payment method to your Apple ID - Apple Support about how to do that. The payment method may not be charged if you also have account balance or the item is free, but the payment method has to be present. This next article lists valid payment methods for different countries but note that in this situation Apple Account balance alone apparently may not meet the requirement and you need to use another payment method until you find one that satisfies Apple's requirement (often a credit or debit card): Payment methods that you can use with your Apple ID - Apple Support .
If you have already entered a payment method, use the second link above to check it. If a message appears in red there is a problem with it. If the information is still correct and current, contact your financial institution.
* Ref.:
Add a payment method to your Apple ID - Apple Support
"To make purchases from the App Store and use subscriptions like iCloud+ and Apple Music, you need at least one payment method on file."
If you can’t download or update apps - Apple Support
- "You might need to have a payment method on file, even if the app that you want to download is free."
Remove a payment method from your Apple ID - Apple Support
- If you have any active subscriptions, you must have at least one payment method on file other than Apple ID credit.
- You might not be able to remove a payment method if you have a balance due.
Sign in with your Apple ID - Apple Support
- "When you sign in to the App Store and other media services for the first time, you might need to add a credit card or other payment information."
How apps, content, and subscriptions from Apple are billed - Apple Support
- You can’t charge gifts to your Apple ID balance. If you send a gift or gift card, your primary payment method is charged.
- Some subscriptions might not be charged to your Apple ID balance.
What you can buy with your Apple Gift Card or Apple Account balance - Apple Support
"Some purchases might require that you have a credit card on file, even if you use your Apple Account balance to make the purchase."