OK, I understand now. I thought you were switching users on the device, but see that you are switching users on Apple Music. Yes, Apple Music is for a single user that is signed in and to switch users, you need to do exactly as you are by signing out first on Apple Music.
When using on a Mac, each user logs into the computer and switching users is done on the Mac to access their Apple Music, along with the rest of the users data such as Photos, emails, and Messages. On the iPhone or iPad, since those devices are not meant to share users, none of the apps are designed with any user switching functionality, other than logging out of your account and then signing in with a different on. You simply would not want 2 people sharing photos, emails, and messages on the device to have 2 accounts with Apple Music.
You just have a unique setup where I could see where the functionality of having user switching on the Apple Music app would be helpful, but would not be useful on a Mac or iPhone.