For family Account and 15 years old
If you encounter the error message "Can't connect to Apple Music Server," there are a few possible reasons.
If you're under 15 years old or part of a family account, content restrictions set by your family organizer may be preventing access. To resolve this, the family organizer should follow these steps:
Open Settings on their phone.
Go to Screen Time > Family > Select your name.
Check that Music Profiles is turned On.
If it's turned off, activate it. Note that it may take multiple tries and up to 15 minutes for the change to take effect.
If you’re still unable to connect, try restarting your device or re-enabling the Music Profiles setting.
You can check in the Apple Music app, you have a music profile. If you don't have one, create one (You can follow this guide provided by Apple https://support.apple.com/guide/music/create-an-apple-music-profile-mus3a76cdc0)
Here a video to check where the content restriction can be changed
There are currently some unresolved issues with family accounts that the service is still working to resolve.
More info on Apple Music support