The stifling innovation argument is faulty anyway. If you are really innovating, then there should be no reason to fear releasing the code for something the company considers obsolete. Unless, that is, such innovation is a red herring and the new product is a mere repackaging of the same, old technology, done exclusively for the sake of artificially sustaining cash flow.
Many products contain proprietary elements that are licensed by third-parties who have no reason to agree to their software being open-sourced. The company I work at constantly gets calls to open-source product X that they discontinued, but they can't because of the reliance on code that doesn't belong to them. And predictably enough, they're not willing to go back and renegotiate a new license for a product that they're discontinuing.
And since open sourcing it does not result in revenue, they cannot justify the cost of vetting the provenance.
A way to fix this would be to shorten patent and copyright terms.
Will it build as-is? Probably not.
Will it build if someone really wants it, and is willing to spend some time to get it to work? Likely.
Will it have the exact same functionalities as the original firmware? Possibly not.
Does it give users a way out of planned obsolescence? Yes.
A penalty large enough to impact the companies you care about here would be business destroying to a small organization. Individuals and companies are not going to want to assume that kind of liability. I don't see how anyone could support this kind of measure if they are thinking about the breadth of business out there.
I'm not saying that the behavior Sonos engaged in here is good - I'm just saying that jumping to "it should be illegal" so quickly without considering all of the secondary impacts is a mistake.
Not active and existing APIs, discontinued ones.
The cost to do the work and the cost to ensure compliance with the law would both be real dollar amounts for most small companies. Enough that if you wanted to try out an experimental new service you'd have to take into account that cost in your budgeting.
Telling a company (or individual) that they need to sit down and pay to kill their products means they will think harder before they launch them. That's a barrier, and it will slow down innovation and make sure that only the companies with the resources to support compliance and open sourcing will be the ones to launch new services.