This isn’t a software problem. It’s a capitalism problem.
It should be straight up illegal to remove pre-existing functionality from a device, regardless of whether that is present in software or hardware. If you release it on a stable channel, if you advertise it as a feature of a device, you support it for the life of the device. You can test beta features via an entirely separate beta app, but once the feature becomes stable you don’t have a choice anymore. Once you stop supporting the hardware or software, you are required to open source everything required for consumers — as well as any competitor — to pickup where you left off and continue development.