Let me tell you my thoughts on it.
If you can afford it, buying solar panels is always going to be more advantageous compared to leasing solar panels because you pay less in the long run, you are the sole owner of the panels, and the value of your property is not negatively impacted through having them installed.
As the owner, you are also entitled to all of the tax rebates and government incentives whereas with leasing, you are not.