In Berachot 10a, it is said that Chizkiyah was punished by Hashem for not having children:
מָה עָשָׂה הַקָּדוֹשׁ בָּרוּךְ הוּא — הֵבִיא יִסּוּרִים עַל חִזְקִיָּהוּ, וְאָמַר לוֹ לִישַׁעְיָהוּ: לֵךְ וּבַקֵּר אֶת הַחוֹלֶה. שֶׁנֶּאֱמַר: ״בַּיָּמִים הָהֵם חָלָה חִזְקִיָּהוּ לָמוּת וַיָּבֹא אֵלָיו יְשַׁעְיָהוּ בֶּן אָמוֹץ הַנָּבִיא וַיֹּאמֶר אֵלָיו כֹּה אָמַר ה׳ צְבָאוֹת צַו לְבֵיתֶךָ כִּי מֵת אַתָּה וְלֹא תִחְיֶה וְגוֹ׳״. מַאי ״כִּי מֵת אַתָּה וְלֹא תִחְיֶה״: מֵת אַתָּה — בָּעוֹלָם הַזֶּה, וְלֹא תִחְיֶה — לָעוֹלָם הַבָּא. אֲמַר לֵיהּ: מַאי כּוּלֵּי הַאי? אֲמַר לֵיהּ: מִשּׁוּם דְּלָא עֲסַקְתְּ בִּפְרִיָּה וּרְבִיָּה. אֲמַר לֵיהּ: מִשּׁוּם דַּחֲזַאי לִי בְּרוּחַ הַקֹּדֶשׁ דְּנָפְקִי מִינַּאי בְּנִין דְּלָא מְעַלּוּ. אֲמַר לֵיהּ: בַּהֲדֵי כַּבְשֵׁי דְרַחֲמָנָא לְמָה לָךְ? מַאי דְּמִפַּקְּדַתְּ אִיבְּעִי לָךְ לְמֶעְבַּד, וּמָה דְנִיחָא קַמֵּיהּ קוּדְשָׁא בְּרִיךְ הוּא — לַעֲבֵיד. אֲמַר לֵיהּ: הַשְׁתָּא הַב לִי בְּרַתָּךְ, אֶפְשָׁר דְּגָרְמָא זְכוּתָא דִידִי וְדִידָךְ, וְנָפְקִי מִנַּאי בְּנִין דִּמְעַלּוּ. אֲמַר לֵיהּ: כְּבָר נִגְזְרָה עָלֶיךָ גְּזֵירָה. אֲמַר לֵיהּ: בֶּן אָמוֹץ, כַּלֵּה נְבוּאָתְךָ וָצֵא! כָּךְ מְקּוּבְּלַנִי מִבֵּית אֲבִי אַבָּא, אֲפִילּוּ חֶרֶב חַדָּה מוּנַּחַת עַל צַוָּארוֹ שֶׁל אָדָם, אַל יִמְנַע עַצְמוֹ מִן הָרַחֲמִים וכו'.
Translated:
What did the Holy One, Blessed be He, do to effect compromise between Hezekiah and Isaiah? He brought the suffering of illness upon Hezekiah and told Isaiah: Go and visit the sick. Isaiah did as God instructed, as it is stated: “In those days Hezekiah became deathly ill, and Isaiah ben Amoz the prophet came and said to him: Thus says the Lord of Hosts: Set your house in order, for you will die and you will not live” (Isaiah 38:1). This seems redundant; what is the meaning of you will die and you will not live? This repetition means: You will die in this world, and you will not live, you will have no share, in the World-to-Come. Hezekiah said to him: What is all of this? For what transgression am I being punished? Isaiah said to him: Because you did not marry and engage in procreation. Hezekiah apologized and said: I had no children because I envisaged through divine inspiration that the children that emerge from me will not be virtuous. Hezekiah meant that he had seen that his children were destined to be evil. In fact, his son Menashe sinned extensively, and he thought it preferable to have no children at all. Isaiah said to him: Why do you involve yourself with the secrets of the Holy One, Blessed be He? That which you have been commanded, the mitzva of procreation, you are required to perform, and that which is acceptable in the eyes of the Holy One, Blessed be He, let Him perform, as He has so decided. Hezekiah said to Isaiah: Now give me your daughter as my wife; perhaps my merit and your merit will cause virtuous children to emerge from me. Isaiah said to him: The decree has already been decreed against you and this judgment cannot be changed. Hezekiah said to him: Son of Amoz, cease your prophecy and leave. Hezekiah continued: I have received a tradition from the house of my father’s father, from King David, the founding father of the dynasty of kings of Judea: Even if a sharp sword rests upon a person’s neck, he should not prevent himself from praying for mercy. One may still hold out hope that his prayers will be answered, etc.
I found this a bit odd: At first Chizkiyah says that he saw in a prophecy that his descendants will be evil - meaning, done-deal, nothing can be done. And then, when Yesha'ayhu tells him that it's already been decreed that he'll die - again, meaning done-deal, nothing can be done - he says: No way, I have a masoret from my forefather King David that even in the face of the worst danger, a person still has the chance to turn things around. Is this supposed to be ironic - that in terms of his descendants, Chizkiyah didn't think this masoret had relevance, but when it became personal - it did, or is this a reflection of his Tshuva process from the beginning of the agadeta to the end? Or is it both? Or something else?