Apparently you have been trying to switch between Apple IDs on this device, even less than a day ago. And that interferes with the device association (1-on-1 link between device and Apple ID) that is required for Apple Music, and several other services. You are not supposed to do this back-and-forth between accounts.
About associated devices - Apple Support (last paragraph):
“When you try to associate another Apple ID with a device that was already associated, you might see a message that says, "This device is associated with another Apple ID. You cannot associate this device with another Apple ID for [number] days." Depending on when you associated your device with your Apple ID, you might need to wait up to 90 days to associate the device with another Apple ID.”
Users can’t change this mandatory wait time themselves. See if the staff can further assist you. iTunes Store - Contact Us - Official Apple Support