Our Gemara on Amud Aleph discusses the Rabbi’s frowning upon disinheriting a child, even partially, and even if the child is considered a wrongdoer. The rabbis say, “It is not known what seed will come from him. Perhaps the bad son will father worthy children.”
The Agra DeKalla (Bo:52) uses this idea to explain a difficult Midrash. The Yalkut Shimoni (208) states:
When the verse says, “And so it shall come to pass when your children ask you, “What is this service that you do” (Shemos 12:26), it is actually good tidings. The Jews of the generation of the exodus were informed that they would have descendants.
Think of the generation of Holocaust survivors. Just knowing that they would have descendants itself would have been an enormous comfort and victory in their moments preceding their liberation.
However, Agra DeKalla raises a problem. Was this not a cold comfort? This verse in the Haggadah is referring to the question of the wicked son. So, this is a comfort, to know they will have wicked sons?
Agra DeKallah answers that, in fact, some of the wicked were redeemed on the credit of their descendants who would become righteous, as our Gemara here tells us. Therefore, the comfort for the Jews was two-fold. One, that there would be descendants and a future to the Jewish people AND two, even if some were astray at this point, they would eventually return.