It sounds to me like you may need to a restore from a good/recent backup, something got stuck somewhere.
One frustration I find is that Apple doesn't allow the backup API to access music, so your music collection doesn't get backed up, that stays in iTunes, which is yet another "lever" in this process -- if you want other "features" like that, you must pay for Apple Music.
Otherwise, you can risk losing your playlists (that's happened to me). Third-party tools that do backup for iOS are also unable to back up your music or even the actual program data (only local, application data can be backed up).
I also observed that the Apple-backup appears to be able to activate your phone in some manner that third-parties cannot.
In any case, back to your circumstance, I'd like someone else to chime in. Because of the above complexity, I go out of my way to replicate my music (iTunes being the master) to my cloud drive, ever time I add music, I mirror it. I have music that is from iTunes but also my own private collection, over 8k -- my music is more precious to me than these silly apps :) I just wish Apple would make this a bit easier and enable more fine-grained controls for advanced users.
Also, iCloud will not back up your music unless you're subscribing to Apple Music -- I don't know the entire feature set. BUT BEWARE, as I've been harmed by this mis-feature: if you reset your phone and connect to iCloud, all of your data is gone. There is no provision for a most recent backup -- this happened to me and I was beyond angry. Fortunately, I was able to get the data from an old backup. Just beware of this, it's a HUGE glaring problem.