Well, there is a huge difference between *buying* solar panels and *investing* in bonds. They don't have anything to do with each other.
Once you've spent your $20,000 on solar panels, it's gone. You bought stuff, you've got the stuff, not the money. Now, your panels may or may not provide...