Foreknowledge does not equal causation. Allow me to show it from the Scriptures, where God foreknows something that does not eventually happen:
1 Samuel 23:11-13
Will the men of Keilah deliver me into his hand? Will Saul come down, as Your servant has heard? O Lord God of Israel, I pray, tell...