I'm experiencing the same problem.
I use Content & Privacy Restrictions as a component of the Screen Time restrictions for my children. I disallowed iTunes & App Store Purchases last night for two of my children. I switched both accounts back to "Allowed" today, but both children quickly told me that they no longer had access to their respective App Stores. I had them reboot their iPhones. I had one of them update his iPhone to the current iOS version. I even rebooted my iPhone. Nothing worked. They only got their App Stores back when I completely turned off Content & Privacy Restrictions. I can't identify the cause, but this started close in time with me updating to iOS 17.5.1, so I have to wonder if that's the issue.