EXTRA · Parashas Vayeishev · Passuk 40:1 · not a Torah Temimah citation on this passuk
Some time later, the cupbearer and the baker of the king of Egypt gave offense to their lord the king of Egypt.
Classical source (EXTRA side-ring): Bereshis Rabbah 88:1.
Sefaria — Bereshis Rabbah 88:1
English: “The cupbearer of the king of Mitzrayim and the baker offended” — why are they mentioned? So that Yosef would come and interpret their dreams.
Derash on the verse (Bereshis Rabbah) — not a formal named middah of the 13. Side characters exist for the sake of Yosef’s path.
The officials’ sin is the means by which Yosef’s gift of interpretation becomes known to Pharaoh.