I don’t think I am following you.
God told him to announce the message, but the message wan’t ‘40 days hence’?
Or Jonah said what God told him, but God’s plan were actually 40 years, not 40 days?
Jonah only had the message God gave him. It did not include the fact that if Ninevah repented God would be merciful.
What Ninevah did after the display of God’s mercy to incur God’s wrath was not Jonah’s business and not part of his prophetic charge. He was to be faithful to as much light as God gave him at the time and that was to proclaim God’s judgment just as he was told. How it ultimately worked out was God’s business.