I'd go even further, if the company goes bankrupt, the company should be required by law to open source the code.
I'm with you, though. This is a place where consumer protection needs to be bolstered.
imo a reasonable middle ground is to prevent companies from locking down access to the vehicle's computers. owners should be able to root and self-manage the software, even if that software has to be painstakingly reverse engineered.
ofc the safety critical systems make that trickier but still.