Rabbi Berachiah opened: "Also to punish the righteous is not good" (Proverbs 17:26). The Holy One, blessed be He, said: Even though I punished Aaron and took his two sons from him, it is not good -- "also to punish the righteous is not good." Rather, "to strike the noble for their uprightness" (Proverbs 17:26): "after the death of the two sons of Aaron" (Leviticus 16:1).
To Punish the Righteous Is Not Good Even for Heaven
Pesikta DeRav Kahana 26:6
[ו] ר' ברכיה פתח גם ענוש לצדיק לא טוב (משלי יז:כו). א' הקב"ה אע"פ שענשתי את אהרן ונטלתי שני בניו ממנו לא טוב, ענוש לצדיק לא טוב, אלא להכות נדיבים עלי יושר (שם), אחרי מות שני בני אהרן (ויקרא שם).