Pri tzadik (vayechi) כי הי"ז שנה שהיה במצרים החיה גם אותם השנים שעברו עליו. וכמו שאמרו (סא"ר פ' ה) כל שהשיגתו שנה א' טובה סמוך לזקנתו סימן יפה לו כו' והעלה עליו הקב"ה כאלו כל ימיו היה בטובה. כי כל ימי יעקב שהיה בצערא לא נקראו חיים אצל יעקב כי לא נשלם בקדושתו ורק במצרים זכה להשתלם בקדושתו. ולכאורה לפי השכל כיון שארץ ישראל מקום המקודש מכל העולם ולאאע"ה אמר הקב"ה לך לך וגו' ושם אעשך לגוי גדול. וליצחק אמר גור בארץ הזאת וגו' והאבות וגם יעקב בעצמו חבבו את הארץ. היה ראוי שישתלם יעקב בקדושתו בארץ הקדושה ולא במצרים בארץ הטמאה ועמה מזוהמים יותר מכל העולם. אכן מצינו כמו כן בגלות בבל ובגלות בית שני שעיקר התפשטות התושבע"פ היה דייקא בבבל. ודייקא שם נתגלה להם רזי התורה מה שלא נתגלה להם בישבם על אדמתם ודייקא בבבל היו אנשי כנה"ג. וא' (סוכה מד.) דלהון היא וכן (שם כ.) עלה עזרא מבבל ויסדה חזרה ונשתכחה עלה הלל וכו' עלו ר' חייא ובניו ויסדוה. ואח"כ התלמוד בבלי שהוא עיקר תושבע"פ שלנו ונתייסד בבבל.
The 17 years that Jacob was in Egypt revived some of those bad years which befell him. This idea is stated (in ) that if an individual lives a good year close to his old age, it is a good sign for him, and G-d considers it as if all his days were good. All the days of Jacob when he was in pain was not considered to be life because they were not completed in holiness (?) and only in Egypt did he merit to complete them in his holiness. Logic would dictate that since Israel is the place of greatest holiness in the world, as G-d told Abraham to leave Aram and go to the land of Israel, and Isaac was told that he would be blessed if he lived in this land. Jacob himself loved the land, and it would have been fitting for Jacob to complete his life in holiness in the holy land, and not in Egypt which is an impure land, and its people are more polluted than any other.
We find that in the exile in Babylon and in the exile of the second Temple that the main expansion of the oral Torah was specifically in exile. Specifically there the secrets of the Torah were revealed, more than was revealed while the Jews were in Israel. It is specifically from Babylon that the people of the great assembly arose and they were able to establish the law of Arava (c.f. Sukkah 44a) We also see in Sukkah (20A) that Ezra rose from Babylon and established Torah, and thereafter Torah was forgotten. Hillel then went and re-established it (and Hillel was also from Babylon (ed)), Rabbi Chiya and his sons (from Babylon) reconstituted the Torah.
This Parasha is closed. Our Rabbis have explained the reasons for it, and they are all true. There is another reason for it being closed. The completion of Jacob's holiness is specifically in Egypt, and not in the land of Israel. This coincides with the notion that the revelation and arrival of the Jewish People which contains the souls which were prepared for the acceptance of the Torah specifically in a foreign land and not in Israel, and that the end of the creation of the world occurs in the land of Egypt. These concepts are closed(Satum) from human understanding.