Then it wouldn't be a hardware switch anymore, just a sensor.
Meaning software could mess something up and "embarrass" you in public, completely voiding the point of the mute switch.
It seems likely that the side switch is anyway connected to software - on iPad its purpose is configurable and I think it was for a short period on iPhone. I always assumed the point of the switch was for quick and convenient access, not for certainty. Besides, the hardware button also fails embarrassingly when full of lint.
But this is exactly how it works. On my 8, I have emergency bypass turned on for my wife. When the hardware switch is turned to the "silent" position, I still get a ring when she calls and a tone when she texts. Everyone else I hear nothing.