Then God saw their works, that they turned from their evil way; and God relented from the disaster that He had said He would bring upon them, and He did not do it.
Not only did the people of Nineveh do something very rare in the history of the Bible by repenting, God also did what was to Jonah very upsetting. God relented and didn’t bring the destruction that Jonah believed Nineveh deserved. God let the 40 days end without bringing destruction.
God tells us He does not change (Malachi 3:6). His laws and justice are not changeable or fickle. But this “failed prophecy” actually helps illustrate one of the purposes of prophecy. Many times prophecies clearly stated that God gives warnings because He wants people to repent and change, but sometimes this went unstated.
God wants to extend mercy and show His love. Jonah was not nearly as eager to see God forgive the brutal Assyrians who would eventually enslave his people. But the book of Jonah shows where Jonah’s thinking did not match God’s. God wants us to learn mercy and to become like He is.