The lead investigator, Mr. van der Walt, left the firm last year. He declined to be interviewed.

No other individual received more attention in the report than Mr. van Loggerenberg, the former head of the so-called rogue unit. But he said KPMG officials had never interviewed him, even after he “begged” on several occasions to present his side of the story.

The legal problems facing Mr. van Loggerenberg and Mr. Pillay are not finished. Both still face criminal charges linked to Project Sunday Evenings, accused of eavesdropping on national prosecutors.

Legal experts say the case appears politically motivated, part of a continuing attempt by the national prosecutors — still led by a staunch Zuma ally — to maintain the narrative of a rogue unit at the tax agency. In recent years, the National Prosecuting Authority, which has been compromised by intense meddling by A.N.C. politicians, has increasingly been used for political ends, the experts said.

The national prosecutors’ spokesman declined to comment.

For KPMG, the inquiry into the tax agency was a lucrative and prestigious contract, bringing in about $2 million and giving the firm a toehold on future work in government. Now critics accuse it of acting as little more than a hired gun in this case, ready to craft reports that fit its client’s wishes.

The investigation was one of many scandals involving KPMG in South Africa and elsewhere. Federal prosecutors in New York indicted four of the firm’s former employees on conspiracy and wire fraud charges in January.

Last month, two British parliamentary committees said KPMG was “complicit” in endorsing the misleading financial statements made by Carillion, a construction giant that collapsed early this year. KPMG, the company’s auditor for 19 years, never raised questions and signed off on management’s “increasingly fantastical figures,” the committees said.

Alex Cobham, chief executive of the Tax Justice Network, a British organization, said the KPMG case in South Africa provided the clearest example of a major Western auditing firm bending the rules to provide governments with “assurance services.”