Are you factoring in the price of your financing?
I very often see that ignored. You either need to include financing costs, or opportunity costs. Spending e.g. $20k isn't free, either you don't have it and need to borrow, or you do and you need to forgo putting it in the S&P500 and getting 7% on it long-term inflation adjusted, which is about $120 a month that you could spend on electricity. For comparison, the average US home uses 900 kWh per month, which is about $90 at average electricity prices in the US.
You can argue the numbers (e.g. 'you're wrong, the S&P500 has lower or higher returns' or 'I paid just 10k, not 20k of my own money'), I'd agree, but you need to consider everything. I find most calculations are often way too generous and omit important aspects.
That's not a reason to not do it, btw... I'd say, if you're underperforming the S&P500 by a little bit while going 100% green on your consumption, that's terrific. But you'd have to admit it's more than just a financial story.
The other side of the story is that you likely aren't consuming your own energy. i.e., you're not paying for storage or expensive peaker-plant backup capacity. If you were the only consumer, or if all consumers were like you, your panels alone would not be sufficient. In other words, there's a cost that has to be paid, and someone else is paying it now. At some point utilities are going to pay you 4-5c per kWh that you put back into the system, and charge you 17c. There is no reason to believe today's feed in tariffs will continue indefinitely. So whatever calculations you make today may not fly in the future, unless you buy your own storage or excess capacity, but then you're not going to get anywhere near the 4-5c figure.
I'm a big believer in solar and I'd love for us to commit more resources, even if it increases prices, it's too important. But we also tend to overstate how cheap everything has become, the narrative on solar is too positive, often portraying solar as if it's ideologically-neutral and financially-interesting when reality iis the opposite. We're still only at 1% of total energy production and we're subsidising it up the wazoo from state and federal incentives to utilities paying retail prices for your energy, and it's still not particularly interesting once you figure in opportunity costs. We still have a long way to go.