In this particular case, we see that Yosef did not want to swear as his father asked, because he wanted to say that he would do all that he could himself. While normally he should only have sworn to ask Par'o for permission to bury Yaakov, Yaakov knew that only an absolute oath given in the full sense (just as Eliezer swore to Avraham) could have allowed the burial to take place.
וְשָֽׁכַבְתִּי֙ עִם־אֲבֹתַ֔י וּנְשָׂאתַ֨נִי֙ מִמִּצְרַ֔יִם
וּקְבַרְתַּ֖נִי בִּקְבֻֽרָתָ֑ם וַיֹּאמַ֕ר אָֽנֹכִ֖י אֶעְשֶׂ֥ה
I will lie with my forefathers, and you shall carry me out of Egypt,
and you shall bury me in their grave." And he said, "I will do as you
The Art Scroll commentary cites Ramban and Seforno explain that Yaakov understood that Par'o would regard it as an insult to Egypt and to himself as embodying the Egyptian state.
This did not imply a lack of trust in Joseph. Rather, Jacob made a
realistic assessmane of the political problem that would arise when
Joseph sought permission for the burial outside of Egypt. Pharoah
would take it as an insultto the land that had given generous
hospitality to Jacob and his family, and he would understand the
request as a demonstration that Israel's allegience did not belong to
Egypt. Only if Joseph were to take a solemn oath would Pharaoh deem it
improper to stand in the way. Indeed, when Pharaoh gave permission to
Joseph, he emphasized that he was doing so because Josephe had
sworn to do so see 50:6
Indeed, we see that as part of the request, Yosef emphasized that his father had made him swear a solemn oath that he would be buried in the cave that had been set up as the sacred burial ground that had already been prepared and was waiting for him. Yosef also said that the oath required him to do this himself (and not through a shaliach) and implicitly promised Par'o that he would come right back.
'My father adjured me, saying, "Behold, I am going to die. In my
grave, which I dug for myself in the land of Canaan, there you shall
bury me." So now, please let me go up and bury my father and return.'
He put it in terms that Par'o would understand that the ground was already sacred to his father and that Yaakov had insisted on a solemn and sacred oath. This meant that any attempt to stop him from carrying out the oath could have caused the bracha that Yaakov had given Par'o and the land of Mitzrayim could have been revoked. Had such an oath been broken, then the entire land would have been cursed. The title of oathbreaker was a very serious one and would never have been allowed.
Indeed, that is why Yosef included his return to Egypt as (implicitly) part of the oath made to his father when he spoke to Par'o.
Even so, Par'o ensured the return by only allowing the brothers to accompany their father, keeping all of the rest of the family as hostages under his protection.