Soon he was being dogged by investigations. He was investigated by both the Special Commissioner of Investigation and the Office of Special Investigations about a makeshift shower that he had installed and paid for himself to use in the morning after exercising.

In 2014, DeWitt Clinton became part of Mr. de Blasio’s Renewal school program, aimed at turning around low-performing schools.

The next year, Mr. Taveras asked the office overseeing Renewal for help addressing problems he had discovered related to how students were assigned to classes, which had led some students to be scheduled for the same class twice, he said. He told the official sent to meet with him that in prior years he had given students elective credit for the duplicate courses, rather than punishing them for administrators’ mistakes. He asked her to conduct an audit of the school’s transcripts to identify all of the problems.

Instead, she contacted the Special Commissioner of Investigation to report that Mr. Taveras had changed course codes on student transcripts.

A few months later, investigators received a package from an anonymous source containing student transcripts and attendance records from DeWitt Clinton, which showed that, in a separate violation of the rules, Mr. Taveras had changed grades for three students, out of the school’s nearly 1,700 enrollment, to passing from failing. (School staff members also appear to have shared some of the documents with The New York Post.)

In one case, the student had a medical condition that she told investigators caused her to miss a lot of school. She said her Global History teacher had reneged on an agreement to give her a passing grade if she completed a supplemental assignment packet and passed the Regents exam, and instead gave her a grade of “No Show.” Mr. Taveras told investigators that over the summer he emailed the Global History teacher, as well as the student’s physical education teacher, who had also given her a failing grade, asking them to review the grades. But they did not respond, he said, so he changed the grades to passing himself.

The grade changes went against department policy. But, said Eric Nadelstern, another deputy chancellor from the Bloomberg years: “There are rules, and there are rules. Not every rule rises to the level of needing to remove a principal.” Nor is there any evidence that the grade changes were an effort to fraudulently boost the school’s results, since changing grades for three students would not significantly affect the school’s graduation rate — a key metric used by the Education Department to judge whether a school is making progress. Nonetheless, the department removed Mr. Taveras and threatened him with termination.