God'S Omniscience And Free Will
It’s impossible for a severely handicapped person go bring you a bottle. He can’t have free will in impossible things. He just can’t do the impossible. His free will is already restricted. You don’t have a free will to become an angel. Similarly It was impossible for abulahab to accept islam and be a devoted muslim because it would prove God wrong. Proving God wrong is impossible and any act which proves God wrong also becomes Impossible.
The announcement of punishment is not like a normal prediction. It is not about knowledge of God but his declaration that he would punish him for what he was doing. It was conditional like the punishment of the Jews. At many places in the Qur’an, God tells that the polytheists of Makkah won’t believe until they see the azab of God. But many ultimately embraced Islam. The difference between threat, announcement of punishment and prediction should be taken into account.