There is the following workaround I discovered: you need to open youe App Store app, tap on account icon, scroll to the bottom, tap "Sign out".
Then you open your app, purchase a subscription, a form for entering Apple ID creds will appear. Fill it with your Sandbox creds, your sandbox acc will be used for purchase.