It is important to note, we are never judged based on our actions, this is the key to this supposed puzzle.
We make this huge assumption that we control our actions, if that was the case, we would be judged based on our actions, but since that's not the case, we are judged based on our intentions.
“All actions are judged by motives, and each person will be rewarded
according to their intention...." (Bukhari)
The idea of "free will" is foreign to Islam, it states clearly in the Quran:
And with Him are the keys of the unseen; none knows them except Him. And He knows what is on the land and in the sea. Not a leaf falls but that He knows it. And no grain is there within the darknesses of the earth and no moist or dry [thing] but that it is [written] in a clear record.
Everything is recorded, and everything is controlled by the creator, there is no exceptions. Even current scientific theories back this up, read on "determinism" for more detail.
So what is our purpose then?
“I have created the jinn and humankind only for My worship.” (Quran 51:56)
How can one worship without free will? It comes back to "intention", even our prayers are not accepted if we don't intend to pray hence, Allah (swt) can make us pray, even if we intend not to pray.
It all leads to the idea of "intention", the question is, does intention equate to "free will"? I think not, we can intend for something to happen, but that will only happen when Allah (swt) wills it, that's why Muslims say "Insha Allah", hence "God Willingly", which is derived directly from the belief that we are not in control of anything really, bur rather just have intentions/hopes/dreams, what ever you want to call it, and those are only manifested by the will of the creator.
Allah Knows Best