This seems like a much neater solution than a right to repair. By making all repairs free for consumers, the repair costs are shifted onto the initial price. This allows for much easier repairability comparisons when shopping (items with high repair costs just become more expensive). It also forces manufacturers to consider product quality much more seriously, as unknowingly releasing a faulty product onto the market, without factoring the repair costs into the price, can significantly affect their profits. It would also significantly help with the "the servers have disappeared and my device is now a brick" issue by forcing manufacturers to keep the appropriate IT infrastructure operational.
Another less radical version of this idea is to force manufacturers to prominently feature a "yearly cost of use", which is basically the price divided by the number of years under warranty (we assume here that the product is designed to be thrown away immediately after the warranty expires). This gives manufacturers an incentive to extend warranties, which also forces more repairability.
The EU kind of sort of does this already, most electronic devices there have a mandatory warranty period, but it's only two years.