Gen 41:45 says:
And Pharaoh called Joseph's name Zaphenath-paneah; and he gave him to wife Asenath the daughter of Poti-phera priest of On. [...]
Rashi, citing Sotah 13b, says that Poti-phera is Potiphar. But this verse tells us that Poti-phera was a priest, while in 39:1 Potiphar was the captain of the guard.
If Potiphar and Poti-phera were the same person, then either (a) the same man was both captain of the guard for Paro and a priest, or (b) he was one and then became the other later. Was either of these plausible in Egypt at that time? Or are these two different, similarly-named people, despite Rashi's comment?
I noticed that the Chabad site that has Rashi online says Poti-phera was governor of On, not priest. I don't understand how they get that when the word is כֹּהֵן, but perhaps whatever they base that on is relevant to answering this question.