Why did Yaakov Avinu not ask G-d about the whereabouts of Yosef during the 22 years that he was away? We know that G-d regularly spoke to Yaakov, so why wouldn't he use one of those opportunities to directly resolve a question that we know he was very distressed about and that was obviously at the forefront of his mind?
Rashi on Bereishis 37:33 says
חיה רעה אכלתהו - נתנצה בו רוח הקדש (ב"ר) סופו שתתגרה בו אשת פוטיפר ולמה לא גלה לו הקב"ה לפי שהחרימו וקללו את כל מי שיגלה ושתפו להקב"ה עמהם (תנחומא) אבל יצחק היה יודע שהוא חי אמר היאך אגלה והקב"ה אינו רוצה לגלות לו
The brothers had sat in court and adjudicated that anyone who would reveal to Yaakov what happened with Yosef would be excommunicated and cursed and they caused Hashem to be part of their judgement. Yitzchok Avinu who did have prophecy during this time, decided to hide it from Yaakov when he realized that Hashem had decided not to tell him.
The Midrash Rabbah also says,
אלא מיום שנגנב יוסף נסתלקה רוח הקודש ממנו ורואה ואינו רואה ושומע ואינו שומע
The 22 years that Yosef was gone from Yaakov, Yaakov lost his prophecy.
The Malbi"m (probably quoting a Midrash I can't find right now) also attributes his lack of prophecy to his mourning over Yosef:
ויעקב חסרו לו ימי אבלו של יוסף, שלא חל עליו רוח הקדש
As the Rambam says in Yesodei HaTorah 7:4 that prophecy only rests on someone who is happy.
According to the Hazal, Yaakov lost his prophecy the entire time that Yosef was gone. The verse describing Jacob's reaction to being told that Joseph was alive (Gen. 45:27):
וַתְּחִ֕י ר֖וּחַ יַעֲקֹ֥ב אֲבִיהֶֽם
And the spirit of their father Jacob was enlivened.
Is rendered by Targum Onkelos as
ושרת רוח קודשא על יעקב אבוהון
The holy spirit [associated with prophecy] rested on their father.
Rabbenu Avraham ben HaRambam (Sefer Hamaspik L'ovdey Hashem, ed. Wincelberg p. 149) cites a tradition that he lost his prophecy and that this was because he was sad. [And one must be happy to experience prophecy, cf. Shabbat 30b].