It came about that
This phrase is used here to mark a new event in the story. (See: rc://en/ta/man/translate/writing-newevent)
This is the person who brought drinks to the king.
This is the person who made food for the king.
offended their master
"upset their master"
the chief of the cupbearers and the chief of the bakers
"the leading cupbearer and the leading baker"
He put them in custody in the house of the captain of the guard
"He put them in the prison that was in the house that was overseen by the captain of the guard"
He put them
The king did not put them in prison but rather he commanded for them to be imprisoned. AT: "He had them put" or "He commanded his guard to put" (See: rc://en/ta/man/translate/figs-metonymy)
in the same prison where Joseph was confined
This can be stated in active form. AT: "This was the same prison that Joseph was in" or "This was the same prison Potiphar put Joseph in" (See: rc://en/ta/man/translate/figs-activepassive)