"Yosef came by them." Where was Yosef coming from?
Oznayim la'Torah #1: He came from the section of the prison where the ordinary inmates like himself were incarcerated, where he slept - to the section that was reserved for V.I.P's, where the butler and the baker were.
Oznayim la'Torah #2 (according to the Midrash): He came from Potifar's home, where he worked during the day. 1
Oznayim la'Torah: Presumably, for the Berachah that Yosef brought to the household. (I did not find that the Midrash says so. (See Midrash Rabah 87:10 - CS) How could Potifar keep Yosef in his house after the episode with his wife, whether he believed her or Yosef? Perhaps he personally ensured that they are never secluded. - PF)
What is the meaning of the word, "Zo'afim"?
Rashi #1: It means 'sad' or 'downcast.' 1
Rashi #2 (to Daniel 2:12): It means 'angry or 'irritated.'
Rashi: As in Melachim I 20:43, and Michah 7:9.
Why were the butler and baker so sad?
Oznayim la'Torah: Because their dreams made an awesome impression on them [and there was no one to interpret them]. 1
Riva: The baker's dream was proper for a bad interpretation. 2 The butler was sad because he dreamed a bad interpretation of the other's dream (refer to 40:5:1:2).
Refer to 40:5:1.1:1 and 40:5:3:2.
Ohr ha'Chayim: Even though he also dreamed a good interpretation for the butler, since he himself was destined for punishment, his Mazel 'told' him and his heart was not settled.