I used to offer a set of suggestions based on Apple documentation as to how to resolve this, but as indicated by the Recommended solution in this topic --> https://discussions.apple.com/thread/253427001
you should just contact official Apple Support about a "billing problem" and let them help you.
===
What is NOT recommended over contacting Apple:
"There is a billing problem with a previous purchase."
You get this message because there is a problem paying for something you bought in the past and this needs to be resolved before Apple will let you make a new purchase, even free items. It isn't a problem with a specific item, it's with your payment method.
This document explains how to 'Change, add, or remove Apple ID payment methods' on an Apple mobile device, a Mac, or a PC; click here --> https://support.apple.com/HT201266
- If you are updating an old card and have ongoing subscriptions you may need to first add the new card and make it the primary payment method before deleting the old card.
If your payment method is declined in the App Store or iTunes Store, click here --> https://support.apple.com/HT203005
"There is a billing problem with a previous purchase." = "you have an unpaid balance in the App Store or iTunes Store"
- 'If you can't remove your last payment method or use no payment method with your Apple ID' click here --> https://support.apple.com/HT203905
If you still have problems Click here --> https://support.apple.com/choose-country-region/media-services Select your country, then a product. If you don't see one that handles your issue then keep experimenting with selections until you reach one that gets you a chat session or a telephone call and get the representative to redirect you.
or:
Contact Apple for support and service --> "See a list of Apple phone numbers around the world." - https://support.apple.com/HT201232