I believe Joseph was not both in prison and with Potiphar, because the Bible is clearly speaking of two different people. In the context of the entire chapter, the supposed linkage quickly falls apart. To place a captain in charge of guards in the context of also managing Pharoh's food preparation may be plausible, meaning he could have been the manager OF the chief baker... but there is no evidence to prove it, and it certainly makes no sense to be a captain and a baker... also note the chief baker was put in prison, meaning HE was responsible for all the kitchen staff.
I did find one article where the "Rosh Ha-tabachim" (supposedly meaning Potiphar) translation is discussed in the same context as you described. As I thought, this 'stretched' translation was conceived by secular scholars, most of whom are highly critical of the Bible as a historical, accurate document.
I would also ask, with Potiphar described in great detail upon his introduction, why is he not also listed as 'chief baker' in addition to the text "an officer of Pharaoh, captain of the guard, an Egyptian..." (Gen 39:1)? And why is the 'chief baker', introduced in Gen 40:1), have only that title and not the other two high-ranking titles Potiphar had?
Also note that two different Hebrew terms are used for 'guard' and 'baker'. Per Strong's Concordance:
Guard -- tabbach tab-bawkh' -- properly, a butcher; hence, a lifeguardsman (because he was acting as an executioner); also a cook (usually slaughtering the animal for food):--cook, guard.
The root being: tabach taw-bakh' -- a primitive root; to slaughter (animals or men):--kill, (make) slaughter, slay.
Baker -- 'aphah aw-faw' -- a primitive root; to cook, especially to bake:--bake(-r, (-meats)).
While 'guard' can be translated as 'cook', it is also used as 'butcher' or 'guard', and it is more logical that Potiphar was in charge of guards who either protected important or average people and also performed executions.
Let us review the Bible verses (KJV) in context:
1) Joseph was sold as a slave to Potiphar (Strongs Condordance: Hebrew -- Powtiyphar po-tee-far' of Egyptian derivation: Potiphar, an Egyptian:--Potiphar).
Genesis 39:1 And Joseph was brought down to Egypt; and Potiphar, an officer of Pharaoh, captain of the guard, an Egyptian, bought him of the hands of the Ishmeelites, which had brought him down thither.
sar sar
a head person (of any rank or class):--captain (that had rule), chief (captain), general, governor, keeper, lord, ((-task- ))master, prince(-ipal), ruler, steward.
2) Joseph was very successful in his work for Potiphar, and was put in charge of Potiphar's business operations.
Genesis 39:3 And his master saw that the LORD was with him, and that the LORD made all that he did to prosper in his hand. Genesis 39:6 And he left all that he had in Joseph's hand; and he knew not ought he had, save the bread which he did eat. And Joseph was a goodly person, and well favoured.
3) After his promotion as overseer, Potiphar's wife began to pursue him for sex.
Genesis 39:7 And it came to pass after these things, that his master's wife cast her eyes upon Joseph; and she said, Lie with me.
4) Joseph candidly put offer her advances, but she was filled with lust for him. Ever been obsessed with someone or something?
Genesis 39:10 And it came to pass, as she spake to Joseph day by day, that he hearkened not unto her, to lie by her, or to be with her.
5) One, being alone in the house, she likely thought he would give in to her.
Genesis 39:11 And it came to pass about this time, that Joseph went into the house to do his business; and there was none of the men of the house there within.
6) She passionately grabbed at him, but Joseph literally ran away. Being a powerful man's spouse, I believe it is likely she was beautiful. Joseph, a man like any other, knew his ethics but also his humanity, and he likely understood that perhaps that even one seductive touch might have proved fatal to him.
Genesis 39:11 And she caught him by his garment, saying, Lie with me: and he left his garment in her hand, and fled, and got him out.
6) She then screamed rape. She first told her servants, but then told Potiphar directly, showing Joseph's torn garment as 'proof'.
Genesis 39:16-18 And she laid up his garment by her, until his lord came home. And she spake unto him according to these words, saying, The Hebrew servant, which thou hast brought unto us, came in unto me to mock me: And it came to pass, as I lifted up my voice and cried, that he left his garment with me, and fled out.
7) Potiphar naturally got very angry, however he did not have Joseph killed, but jailed. Note the jail was 'the kings' jail, not Potiphar's jail.
Genesis 39:20 And Joseph's master took him, and put him into the prison, a place where the king's prisoners were bound: and he was there in the prison.
8) From this point there is no mention whatsoever of Potiphar, etc. Everything that follows is focused on Joseph's prison experience. Though circumstances have again grown very dark, the Lord continues to show Joseph that He is with him.
Genesis 39:20-22 And Joseph's master took him, and put him into the prison, a place where the king's prisoners were bound: and he was there in the prison. But the LORD was with Joseph, and shewed him mercy, and gave him favour in the sight of the keeper of the prison. And the keeper of the prison committed to Joseph's hand all the prisoners that were in the prison; and whatsoever they did there, he was the doer of it.
9) The idea of the 'head chef' being Potiphar himself really makes no sense at all. You quote no verses, so I can't comment on them. However the KJV text clearly states the obvious, persons in charge of the butlers and the bakers.
Genesis 40:1-3 And it came to pass after these things, that the butler of the king of Egypt and his baker had offended their lord the king of Egypt. And Pharaoh was wroth against two of his officers, against the chief of the butlers, and against the chief of the bakers. And he put them in ward in the house of the captain of the guard, into the prison, the place where Joseph was bound.