I think that might just be a bug. Or maybe something in your headphones is causing it to send a "play" command through Bluetooth? That will open the Music app if you have nothing playing already.
Given that the headphones cannot know if there's an app playing already, this should be configurable in the OS: i.e. allow selecting which app (or no one) to launch when receiving a Play command
Only allowing their own app to be associated with the default audio player is anti-competitive, at the very least
It should be configurable (it is, but only through Terminal), but it's also such a minor problem that I can't blame Apple for not wanting to create the API for third parties, design and build the UI, and then document, support, and maintain all of it for years to come. You have to pick your battles as a developer and being an OS dev is no different.
Only allowing their own app to be associated with the default audio player is anti-competitive, at the very least