As others have said, the phone-as-key and Bluetooth music streaming are separate functions. Both rely on Bluetooth, but in different ways, so one can work even if the other doesn't.
I've experienced the problem of the phone unlocking but the car not driving once or twice myself, but it's been pretty rare. (I've had my Model 3 for about 8 months now.) Based on my own experience, I'd chalk it up to a random glitch -- it could be caused by some weird RF interference, the phone or car computer rebooting (although you'd probably notice those, especially the car), etc. You might also want to consider whether you have any other phones configured as keys. It's conceivable that their Bluetooth signals are interfering with one another in some odd way....
To elaborate on the above, I have three phones configured as Tesla keys. Just today, I returned from running some errands and then needed to go back to my car, but it wouldn't let me in. The phone I was using reported a Tesla app status of "disconnected." My other phone reported it was "connected" -- but I knew from prior testing that it wouldn't work as a key even when "connected" from the location in which it was sitting (about 30 feet away from the car, through a wall). Long story short: To get my primary phone working as a key again, I had to temporarily set my other phones to airplane mode and re-pair my primary phone as a key. I have no idea what went wrong, but the trick that finally got it working was to disable those other two phones' radios. After re-enabling them, they all seem to be working again. This bit of weirdness is obviously not analogous to your situation in any detail; I mention it simply to point out that there can be weird interactions between multiple phones when they're all configured as keys. Simplifying by turning them off or setting them to airplane mode may help you diagnose and correct the problem.