CAPE TOWN — The Boston consulting firm Bain and Company, which usually gets top dollar for its meticulously researched advice, charged $11 million on a contract in 2015 to advise South Africa’s tax agency on an ambitious restructuring plan.

Now, the firm has acknowledged that its work on a “diagnostic report” on the agency was shoddy. It did not meet with senior officials involved in the tax agency’s modernization. It was ignorant of basic facts about the institution. And it did not even ask why the agency needed restructuring in the first place.

Bain admitted interviewing just 33 of the agency’s employees — including one senior official for less than 15 minutes. All had been chosen by the agency’s leader, a compromised ally of Jacob Zuma, then the president, raising questions of undue influence.

In an even more embarrassing turn, Bain admitted that it might have been a pawn in local political wrangling designed to help Mr. Zuma avoid scrutiny into his own taxes. The tax agency was among many government organizations gutted by corruption during his presidency. Before Mr. Zuma’s intervention, the national tax office had been an extraordinary triumph and was considered critical to collecting money the government needed to function at its most basic level.