Very easy to answer this question .
If we don't have free will then Nineveh could not repent .
And since Nineveh repent then God could choose to repent aswell and not destroy them .
If we did not have free will God would not be able to repent , because he would just follow his plan , yet we can see multiple times that God himself repent from doing something like in Exodus 32:14.
It's glory of God that he is greater than our free will that he know what we choose before we will choose or even be alive . If God did not know what we choose then he would be limited and we know that this is not the case .
Except that it is God who grants and gives and ordains repentance.
Example
Acts 5:31
Him God has exalted to His right hand
to be Prince and Savior,
to give repentance to Israel and forgiveness of sins.
Acts 11:18
When they heard these things they became silent; and they glorified God, saying, “
Then God has also granted to the Gentiles repentance to life.”
Acts 13:24
after John had first preached, before His coming, the
baptism of repentance to all the people of Israel.
Acts 19:4
Then Paul said, “John indeed baptized with a
baptism of repentance, saying to the people that they should believe on Him who would come after him, that is, on Christ Jesus.”
2 Corinthians 7:10
For godly sorrow produces repentance leading to salvation, not to be regretted; but the sorrow of the world produces death.
2 Timothy 2:25
in humility correcting those who are in opposition,
if God perhaps will grant them repentance, so that they may know the truth,
And here, examples of repentance not granted by God.
Hebrews 6:6
if they fall away, to renew them again to
repentance, since they crucify again for themselves the Son of God, and put
Him to an open shame.
Hebrews 12:17
For you know that afterward, when he wanted to inherit the blessing, he was rejected, for he found no place for
repentance, though he sought it diligently with tears.