It is not a bug. A bug is something that doesn't work the way it was designed. The Mute switch on the iPhone is working the way it was designed to work. It silences some things, but not others that it would make no sense to silence. Why would you play music if you didn't want to listen to it? If your wakeup alarm did not sound because you left the switch in Mute position you would be justifiably annoyed. If you couldn't hear the caller on a phone call because the mute switch was on that would be pretty stupid. Note that it will silence the ring if you have "vibrate" enabled. If you don't the phone will still ring; otherwise, how would you know someone was calling you? The mute function has been well thought out and refined in the 10 years since the iPhone was released.
Note that this forum is not a way to communicate with Apple. It is a user-to-user technical support forum. Apple does not participate. If you want to present an opinion to Apple use https://apple.com/feedback.