Why wait five years? The hardware stops being sold on date X, the software/firmware must be published the same day.
> In a lot of cases it might be better using older hardware as new features would be added by the community forever!
And here you have found why the OEM's will fight via hordes of lobbyists any attempt to legislate a required publishing of software/firmware for out of production hardware. Keeping the old hardware useful after the OEM end-of-life's it means the OEM sees a smaller number of future sales of their "new and improved V2.0" [1] hardware, equating directly to lower revenue and profit.
[1] where what is "new and improved" is often nothing more than eye candy to convince you to give up your 1.0 version and buy the 2.0 variety.