Greetings toothbrush34,
Thanks for reaching out to the Apple Support Communities! It sounds like you have an issue with playing your Apple Music when your device is locked. Since this is affecting the Music app, take a look at these steps first:
If the behavior continues, we'd also suggest removing and redownloading the Music app to your device. Please keep in mind that this will remove any content you've downloaded and will need to be downloaded again:
- On your iOS or iPadOS device, touch and hold the app.
- Tap Rearrange Apps.
- Tap in the upper-left corner to delete the app.
- Tap Delete. Then on an iPhone X or later, tap Done. Or on an iPhone 8 or earlier, press the Home button.
If you have an Apple Watch, deleting an app from your iPhone also deletes that app from your Apple Watch.
- On your iOS or iPadOS device, go to the App Store.
- Search for the app. Make sure that you use the exact name of the app. Find the correct name of built-in apps.
- Tap to restore the app.
- Wait for the app to restore, then open it from your Home screen.
If you have an Apple Watch, restoring an app to your iPhone also restores that app to your Apple Watch."
Delete built-in Apple apps on your iOS 12, iOS 13, or iPadOS device or Apple Watch
Let us know the results and have a great day!