Automation to prevent Apple Music launching on Bluetooth disconnect?

When I use my AirPods with my Mac and disconnect them later, it automatically opens Apple Music. It’s super annoying. Has anyone figured out a way to stop this? Maybe using BTT to automatically close Apple Music when it launches after disconnecting? I even found an app that fixes this (noTunes), but I’d rather not install a third-party app just for this one issue.

That is weird behavior - something must be launching your Apple Music as this is not default behavior.

You could probably do something like this but I'd rather try to figure out why Music is launching