Perhaps, that is the way 2 Kings records it, but 2 Chronicles 32:24-26 may imply that he had to repent and Isiah 38 confirms what I had said.
Certainly this passage tells us of his sin: -
2 Kings 18:13-16: - 13 And in the fourteenth year of King Hezekiah, Sennacherib king of Assyria came up against all the fortified cities of Judah and took them.
14 Then Hezekiah king of Judah sent to the king of Assyria at Lachish, saying, "
I have done wrong; turn away from me; whatever you impose on me I will pay." And the king of Assyria assessed Hezekiah king of Judah three hundred talents of silver and thirty talents of gold.
15 So Hezekiah gave him all the silver that was found in the house of the Lord and in the treasuries of the king's house. 16 At that time Hezekiah stripped the gold from the doors of the temple of the Lord, and from the pillars which Hezekiah king of Judah had overlaid, and gave it to the king of Assyria.
Isaiah 38:21 gives us the following information about why Hezekiah was dying: -
Isaiah 38:21: - Now Isaiah had said, "Let them take a lump of figs, and apply it as a poultice on the boil, and he shall recover."
He was dying because he had a boil that would not heal.
The king did not trust in the Lord to save him or Jerusalem at this time. That was his sin that he had to repent of.
Shalom