Actually Ovo energy is trying to do that - they estimate a reduction in your energy bills based on installing an energy efficient system like solar, heat pump, loft insulation, etc. Then they carry out the work and you pay it off gradually through your energy bills.
The challenge I think is then if you want to leave them then you have to either repay that debt or the next energy company has to assume it. There’s a few ways it could be abused and of course the savings take years or even decades to pay off, so there’s a few kinks to work out.
I hope they manage to get it working though, it will be big for UK customers.
Our climate is changing and we need research like this to ensure that we can still grow food productively in regions where weather is causing crops to fail.