[After the death of Aaron's two sons (Leviticus 16:1).] The Holy One, blessed be He, said to him: Aaron, did I not write thus in My Torah, "For every matter of trespass, for an ox [etc.]" (Exodus 22:8)? Do you not remember what you did with the ox, as it is said, "And they exchanged their glory for the likeness of an ox" (Psalms 106:20)? "For a donkey" — those Egyptians, of whom it is written, "whose flesh is the flesh of donkeys" (Ezekiel 23:20); you made for them a calf so that they might bow down to it, [as it is said,] "And the mixed multitude that was in their midst" (Numbers 11:4). "For a lamb" — these are Israel, as it is said, "Israel is a scattered lamb" (Jeremiah 50:17). "For a garment" — that one of whom it is written, "You have a garment, come, be a ruler over us" (Isaiah 3:6). "For any lost thing" — for of them it is written, "My people were lost sheep" (Jeremiah 50:6). "Of which one says, 'This is it'" — those who said, "These are your gods, O Israel" (Exodus 32:8). "The cause of both parties shall come before the judges [God]" — this is Moses, of whom it is written, "See, I have made you a god to Pharaoh" (Exodus 7:1); Moses sat and judged them. "Whom the judges [God] condemn" — these are the judges, of whom it is written, "You shall not revile the judges [God]" (Exodus 22:27). "He shall pay double to his fellow" — these are the two sons of Aaron. Thus, "After the death of Aaron's two sons."
God Rebukes Aaron Over the Golden Calf in Tanchuma
Midrash Tanchuma Buber, Achrei Mot 12:2
[אחרי מות שני בני אהרן]. א"ל הקב"ה אהרן לא כך כתבתי בתורתי, על כל דבר פשע על שור [וגו'] (שמות כב ח), אין אתה זכור מה עשית בשור, שנאמר וימירו את כבודם בתבנית שור (תהלים קו כ), על חמור, אותן מצרים שכתיב בהן, אשר בשד חמורים בשרם (יחזקאל כג כ), עשית להן עגל שיהיו משתחוים לו, [שנאמר] והאספסוף אשר בקרבו (במדבר יא ד), על שה, אלו ישראל, שנאמר שה פזורה ישראל (ירמיה נ יז), על שלמה, אותו שכתיב בו שמלה (לך) [לכה] קצין תהיה לנו (ישעיה ג ו), על כל אבידה שכתיב בהן צאן אובדות היו עמי (ירמיה נ ו), אשר יאמר כי הוא זה, אותן שאמרו (זה) [אלה] אלהיך ישראל (שמות לב ח), עד האלהים יבא דבר שניהם, זה משה שכתיב בו ראה נתתיך אלהים לפרעה (שם ז א), ישב משה ודנן, אשר ירשיעון אלהים, אלו דיינין, שכתיב בהם אלהים לא תקלל (שם כב כז), ישלם שנים לרעהו, אלו שני בני אהרן, הוי אחרי מות שני בני אהרן.