SolarCity, the nation’s leading installer of rooftop solar panels and a renewable energy darling, has pitched its value to investors on a simple premise: Once customers sign up to lease a system, they will make payments to the company month after month for at least 20 years.

But even when the customers look good enough on paper, it does not always work out that way.

In dozens of cases over the last three years, The New York Times has found, SolarCity has reached long-term lease agreements with homeowners shortly before or even after they defaulted on mortgages. In at least 14 cases, the homeowners were already in default, or had other liens on the property, by the time SolarCity filed paperwork about the panels with the government.

The cases raise questions about how well the company vets customers. In addition, it is unclear how many foreclosure lawsuits involve the company over all.

In September, a lawyer for SolarCity, Mohammed Ahmed Gangat, filed a document in New York state court arguing that the company needed to file another document late because it had in recent months been “inundated with hundreds of lawsuits in New York, and thousands across the country, all of which have named SolarCity as a defendant in a residential foreclosure action.”