There's obviously some kind of bug here, and one that Apple should rightfully be lambasted over, but given that plenty of people, including me, have used Apple Music without anything local getting deleted, it's pretty obviously not intended behavior.