The answer is that the consequence of the tzaddik's passing away is dependent on the people's reaction to it. If they mourn and eulogize him properly his death protects them from danger midah k'negged midah; just like they were kind to the deceased tzaddik by mourning and eulogizing him so too Hashem is kind with them and annuls the difficult decree.
However, if they do not mourn and eulogize him properly not only does the death not protect them from danger but on the contrary it adds to their punishment!
The second part of the answer is that at the Bris Bein HaBesarim, Hashem told Avraham that his descendants would have to be enslaved for four hundred years. This decree is not incidental that can be circumvented, but it is essential for Klal Yisroel to experience in order to be purified, be able to receive the Torah and to totally connected to Hashem.
According to this, Zera Shimshon resolves the contradiction of the two Rashi's in the following way.
The suffering of the bondage actually started only with the passing away of all the children of Yaakov like Rashi wrote in Parshas Va'airo. However, when Yaakov passed away Hashem was concerned that his children would properly eulogize and mourn him and this would nullify the decree of four hundred years of bondage. Since the bondage was needed to purify and cleanse us, therefore, in the beginning, at the time of the death of Yaakov, Hashem "closed their eyes and numbed their hearts" in order that they wouldn't properly mourn and eulogize Yaakov and Hashem would be able to bring on Bnei Yisroel the suffering that was needed to purify Bnei Yisroel.
In other words, Rashi doesn't mean, like Zera Shimshon initially thought and is the simple meaning of Rashi, that it was the suffering of the bondage that made their heart and eyes to close. This can't be because Rashi in Parshas Va'airo writes that the bondage didn't start until the last of Yaakov's children died. Rather Rashi means that because Hashem needed to bring the suffering of the bondage Hashem closed their eyes and hearts so they wouldn't properly eulogize and mourn Yaakov which would have prevented the Jewish people to be enslaved.
According to this explanation, that there was no enslavement at all as long as some of Yaakov's children were alive, Rashi never explains how Hashem prevented them from properly mourning Yaakov.