This week's Sedra, Parshas Vayechi, is unique in that it is the only Sedra without a separation between it and the previous Sedra. This is different than all other parshios that either start on a new line or have nine empty spaces before it.
Rashi explains in the name of the Medrash that the reason for this is that in this Sedra the Torah relates that Yaakov Avinu passed away and Klal Yisroel's eyes and heart closed from the suffering of the bondage in Mitzrayim. To allude to the fact that Klal Yisroel's eyes were closed, the Torah "closed" and hid the beginning of this parsha.
Zera Shimshon asks that this Rashi implies that the pain of the bondage started immediately after Yaakov Avinu's passing. However, Rashi in Parshas Vayairah (Shemos 6/15) seems to contradict this. There he writes that the bondage did not start until all of the children of Yaakov passed away and not, like he writes here, when Yaakov himself passed away.
Zera Shimshon gives an answer that contains two parts.
It is written, "ki mipnay hara'ah ne'esaf hatzaddik- because of the impending calamity the tzaddik is gathered. Meaning, that before Hashem brings a calamity, a tzaddik passes away. We find in Chazal two seemingly contradictory explanations why this is.
One explanation is that when there is a decree against Klal Yisroel Hashem picks and takes away a tzaddik from this world in place of and to save other people from this decree. According to this the possuk means, because of an impending calamity, Hashem gathered a tzaddik in order to save the others from that calamity.
The second explanation is that tzaddikim act as shields and protection for Klal Yisroel. Therefore, Hashem gathers the tzaddik, meaning he has him die, in order that the people will not be saved! According to this explanation the possuk means, because of an impending calamity, Hashem gathered a tzaddik in order to bring a calamity on others.
In other words, according to the first explanation the tzaddik dies in order to save others from disaster and according to the second explanation the tzaddik dies in order to be able to bring disaster on the people. How can this be?