Hello Matt,
Thanks for reaching out to the Apple Support Communities! I see from your message that you're being prompted to sign into Apple Music and iTunes when you go to use it on your Windows PC as well as your iPhone.
To begin, quit iTunes on your Windows PC, and the Music app as well as the iTunes Store on your iPhone. Once the apps are closed, restart both devices. The steps to restart your iPhone can vary by model. This article will help you find the steps for your iPhone model: Restart your iPhone.
Based upon the error you're seeing there may be a problem with the connection to the iTunes Store servers. Once the devices have restarted, follow these steps: If you can't connect to the App Store, iTunes Store, or other Apple services. As is mentioned in the last line of the article: "If you’ve tried all of the above steps and you still can’t connect, contact Apple Support."
All the best.