Our Gemara on Amud Beis quotes a verse in Daniel (22:17):

וָאֶשְׁמַ֞ע אֶת־הָאִ֣ישׁ ׀ לְב֣וּשׁ הַבַּדִּ֗ים אֲשֶׁ֣ר מִמַּ֘עַל֮ לְמֵימֵ֣י הַיְאֹר֒ וַיָּ֨רֶם יְמִינ֤וֹ וּשְׂמֹאלוֹ֙ אֶל־הַשָּׁמַ֔יִם וַיִּשָּׁבַ֖ע בְּחֵ֣י הָעוֹלָ֑ם כִּי֩ לְמוֹעֵ֨ד מֽוֹעֲדִ֜ים וָחֵ֗צִי וּכְכַלּ֛וֹת נַפֵּ֥ץ יַד־עַם־קֹ֖דֶשׁ תִּכְלֶ֥ינָה כׇל־אֵֽלֶּה׃

Then I heard the man dressed in linen, who was above the water of the river, swear by the Ever-Living One as he lifted his right hand and his left hand to heaven: “For a time, times, and half a time; and when the breaking of the power of the holy people comes to an end, then shall all these things be fulfilled.

The simple reading of the verse seems to be a prophecy about a future time when redemption will come, even if after pain and destruction to the breaking point. Is there a final time where the Mashiach will come, no matter the condition or deservedness of the Jewish people ?

The Gemara Sanhedrin (97a) records a theological dispute, where Rabbi Eliezer and Rabbi Yehoshua engaged in a whirlwind discussion of verse after verse throughout scripture. Some verses seem to indicate that redemption will only come through repentance, and others seem to indicate that redemption will come regardless. The Gemara seems to conclude that Rabbi Eliezer lost the debate, and conceded that redemption will come regardless. conceded that redemption will come regardless:

אמר רב כלו כל הקיצין ואין הדבר תלוי אלא בתשובה ומעשים טובים ושמואל אמר דיו לאבל שיעמוד באבלו כתנאי ר' אליעזר אומר אם ישראל עושין תשובה נגאלין ואם לאו אין נגאלין אמר ליה רבי יהושע אם אין עושין תשובה אין נגאלין אלא הקב"ה מעמיד להן מלך שגזרותיו קשות כהמן וישראל עושין תשובה ומחזירן למוטב

Rav says: All the ends of days that were calculated passed, and the matter depends only upon repentance and good deeds. When the Jewish people repent, they will be redeemed. And Shmuel says: It is sufficient for the mourner to endure in his mourning to bring about the coming of the Messiah. Even without repentance, they will be worthy of redemption due to the suffering they endured during the exile. The Gemara notes: This dispute is parallel to a dispute between tanna’im: Rabbi Eliezer says: If the Jewish people repent they are redeemed, and if not they are not redeemed. Rabbi Yehoshua said to him: If they do not repent, will they not be redeemed at all? Rather, the Holy One, Blessed be He, will establish a king for them whose decrees are as harsh as those issued by Haman, and the Jewish people will have no choice but to repent, and this will restore them to the right path.

תניא אידך ר' אליעזר אומר אם ישראל עושין תשובה נגאלין שנאמר (ירמיהו ג, כב) שובו בנים שובבים ארפא משובותיכם אמר לו רבי יהושע והלא כבר נאמר (ישעיהו נב, ג) חנם נמכרתם ולא בכסף תגאלו חנם נמכרתם בעבודת כוכבים ולא בכסף תגאלו לא בתשובה ומעשים טובים

It is taught in another baraita that Rabbi Eliezer says: If the Jewish people repent they are redeemed, as it is stated: “Return, wayward children, I will heal your iniquities” (Jeremiah 3:22). Rabbi Yehoshua said to him: But isn’t it already stated: “So says the Lord: You were sold for naught, and without money you shall be redeemed” (Isaiah 52:3)? Rabbi Yehoshua explains: “You were sold for naught” means you were sold for idol worship, which is a sin with no basis. “And without money you shall be redeemed” means you will be redeemed not through repentance and good deeds, but through the will of God.

אמר לו רבי אליעזר לר' יהושע והלא כבר נאמר (מלאכי ג, ז) שובו אלי ואשובה אליכם אמר ליה רבי יהושע והלא כבר נאמר (ירמיהו ג, יד) כי אנכי בעלתי בכם ולקחתי אתכם אחד מעיר ושנים ממשפחה והבאתי אתכם ציון

Rabbi Eliezer said to Rabbi Yehoshua: But isn’t it already stated: “Return to me and I will return to you” (Malachi 3:7)? Rabbi Yehoshua said to him: But isn’t it already stated: “For I have taken you to Myself; and I will take you one from a city and two from a family, and I will bring you to Zion” (Jeremiah 3:14), unconditionally?

אמר לו ר' אליעזר והלא כבר נאמר (ישעיהו ל, טו) בשובה ונחת תושעון אמר לו ר' יהושע לרבי אליעזר והלא כבר נאמר (ישעיהו מט, ז) כה אמר ה' גואל ישראל וקדושו לבזה נפש למתעב גוי לעבד מושלים

Rabbi Eliezer said to him: But isn’t it already stated: “In ease [beshuva] and rest shall you be saved” (Isaiah 30:15), indicating that redemption is dependent upon repentance [teshuva]? Rabbi Yehoshua said to Rabbi Eliezer: But isn’t it already stated: “So says the Lord, Redeemer of Israel, his Holy One, to him who is despised of man, to him who is abhorred of the nation, to a servant of rulers:

מלכים יראו וקמו שרים וישתחוו

Kings shall see and arise, princes shall prostrate themselves, because of the Lord, Who is faithful, and the Holy One of Israel, Who has chosen you” (Isaiah 49:7), indicating that redemption will come independent of repentance?

אמר לו רבי אליעזר והלא כבר נאמר (ירמיהו ד, א) אם תשוב ישראל נאום ה' אלי תשוב אמר לו רבי יהושע והלא כבר נאמר (דניאל יב, ז) ואשמע את האיש לבוש הבדים אשר ממעל למימי היאור וירם ימינו ושמאלו אל השמים וישבע בחי העולם כי למועד מועדים וחצי וככלות נפץ יד עם קדש תכלינה כל אלה וגו' ושתק רבי אליעזר

Rabbi Eliezer said to him: But isn’t it already stated: “If you will return, Israel, says the Lord, return to Me” (Jeremiah 4:1), indicating that redemption is contingent upon repentance? Rabbi Yehoshua said to him: But isn’t it already stated: “And I heard the man clothed in linen, who was above the waters of the river, when he lifted up his right hand and his left hand to heaven and swore by the One Who lives forever that it shall be for a period, periods, and a half; when the crushing of the power of the holy people shall have been completed, all these things shall be finished” (Daniel 12:7), indicating that the time for redemption is set and unrelated to repentance? And Rabbi Eliezer was silent, unable to refute the proof from that verse.

The Maharal (Netzach Yisrael 31) attempts to explain this debate with more nuance. It cannot be that Rabbi Eliezer believed there was any possibility that the Messiah would never come. Rather, he believed that they were moments in time that were prime for redemption. If the Jews had repented, any of these times would have brought about the redemption. However, the argument was about what would happen if the Jews would not repent. Rabbi Eliezer’s disputants believed that there is an idea that God would bring the Messiah at some terminal point, even without repentance. On the other hand, Rabbi Eliezer believed that eventually somehow the Jews would repent, even if circumstances had to become so dire as to force them to do so. The point being, according to Rabbi Eliezer, the advent of the Messiah still requires repentance. But the ultimate eventuality was that one day the Messiah will come, and that was never in dispute. 

The Maharal raises the question: Still, how could Rabbi Eliezer be so confident that at some point, somehow, the Jews live repent. Isn’t it theoretically possible that they never would? To this, Maharal explains that there are events and occurrences in the world, and then there are fundamental steady states. The Jewish attachment to God, like God himself, is not an occurrence, but a fundamental steady state and reality. Incidental occurrences are always subject to entropy and change. Disconnection from God is the incidental; however, the return and connection to God is an ultimate truth.  (And, even so, it would seem that Rabbi Eliezer lost the debate and conceded that the Messiah will come anyway, even without repentance)

Think of it this way, you can have a building that’s built very strong. It could look like it will last for 1,000 years, perhaps 10,000, but one thing you know for sure, since it is an occurrenceand a construct, it will eventually decay and fall apart. The Maharal’s clever reframe is that connection to God is the fundamental state that we all will return to; it’s just a matter of time. Exile is merely a temporary occurrence. I find this to be highly comforting.