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.”

But when asked about that filing, SolarCity said that it was currently involved in far fewer cases — 139 — and that the lawyer had been mistaken. The company said the court filing had been made without the company’s reviewing or approving it. Mr. Gangat is not a SolarCity employee.

“Out of more than 305,000 installed customers, SolarCity is currently involved in 139 such proceedings,” the company said in a statement. “The litigation is not adversarial — being named in the foreclosure proceeding provides us with advance notice that we need to reassign a contract, and many are immediately resolved with the relevant bank.”

The company is also involved in foreclosure proceedings outside the courts but said it could not say how many.

Mr. Gangat did not immediately respond to calls or emails.

If the lawyer’s figures are correct, SolarCity, which is now owned by the automaker Tesla, may be facing a threat to its financial performance that it has not disclosed to the government and investors. The foreclosures can lead to a pause, or an end, of the lucrative monthly payments customers pay for the leases.

If the lawyer’s figures are false, he could face disciplinary proceedings under ethics rules, depending on the circumstances. The company said it was planning to have the document filed in court on its behalf corrected.

In either situation, details of the cases identified by The Times raise questions about how well the…