Hello, I have the solution for this problem. This is the most popular thread on the 1th side on Google so I decided to share it with you.
After you canceled the Apple Music subscription and you'll get the error message "To change stores, you must first cancel your Apple Music membership" you have to do the following steps:
- Go to the App Store
- Click on the picture frame in the right upper corner
- Scroll down to sign out and click it
- Close the App Store
- Go to Settings -> click on your name on the top -> iTunes & App Store
- You will asked if you wanna change the store country after you tipped in your Apple-ID, so click on confirm
- done
I hope this help. I very happy because my Apple Music subscription expired in December.