Apple Music's deep integration with both iOS and iTunes is handy, but it's not all rainbows. Over on the Loop, Jim Dalrymple details how disabling Apple Music in iTunes also destroyed about 4700 songs in his iTunes library.
After a series of problems with Apple Music, Dalrymple decided to cut his losses and turn it off. When he did that, he found about 4700 songs missing:
As if all of that wasn't enough, Apple Music gave me one more kick in the head. Over the weekend, I turned off Apple Music and it took large chunks of my purchased music with it. Sadly, many of the songs were added from CDs years ago that I no longer have access to. Looking at my old iTunes Match library, before Apple Music, I'm missing about 4700 songs. At this point, I just don't care anymore, I just want Apple Music off my devices.
So, if you're using Apple Music, there's a chance you might lose some songs when you shut it off, so make sure you have a recent backup before you do.