Do not confuse God's foreknowledge with predestination. There is no contradiction. The fact that God knows something in advance does not force the will of the person to act in any particular way. God simply knows the decisions the person will make in advance.
John 10:28, I give them eternal life, and they shall never perish; no
one will snatch them out of my hand.
This verse simply says that no power in heaven or on earth can remove us from God's "hand" (= salvation); the obvious exception is the personal choice of the person! John 6:39 is similar.
John 17:12 should be understood in the light of John 7:17 -
Anyone who chooses to do the will of God will find out whether my
teaching comes from God or whether I speak on my own.
See the appendix below. Further the Bible contains examples of people who were saved and then rejected that salvation and similar warnings - here is a brief sample:
- Rom 11:17-21 discusses the warning that people who had been grafted into the “olive tree” of the Christian community could be broken off if they were unfaithful.
- 1 Cor 9:27 Paul says he disciplines his body to keep it under control so that after preaching to others he does not become a castaway/disqualified. That is, Paul believed that it was possible that he could lose his way and become lost.
- 1 Cor 10:12 also contains a stern warning from Paul, “If you think you are standing firm, be careful that you don’t fall.”
- 1 Tim 6:10, For the love of money is the root of all kinds of evils. It is through this craving that some have wandered away from the faith and pierced themselves with many pangs.
- Heb 2:1-3, We must pay closer attention, therefore, to what we have heard, so that we do not drift away. For if the message spoken by angels was binding, and every transgression and disobedience received its just punishment, how shall we escape if we neglect such a great salvation?
- Similarly, Heb 6:4-6 also teaches that some “who have once been enlightened, who have tasted the heavenly gift, who have shared in the Holy Spirit…” can fall away.
APPENDIX - Bible teaches Freedom of Choice
- Gen 2:16, 17 – the original choice given to Adam and Eve to choose service to God.
- 1 Cor 10:13 – God is gracious enough to only allow temptations that we can bear. This reveals that God recognises the effect that sin has on our will; sin weakens our will but God helps by both strengthening our will and only allowing temptations that we can bear.
- 2 Peter 3:9 – God is patient wanting all people to decide for Him.
- Gal 5:13 – We are given freedom by God but the privilege should not be abused.
- John 7:17 – People can choose to do the will of God and such a choice bring further enlightenment.
- Josh 24:15 – The Israelites were encouraged to choose God.
- Mark 8:34 – Choosing to serve God involves personal sacrifice which is why it is such a serious decision.
- Rev 3:20 – God wants to be with us but we must choose to allow Him into our lives.
- Gal 5:16, 17, John 8:34-36 – Sin enslaves but the Christian life by the Spirit gives freedom.
- Isa 55:6, 7 – Isaiah encourages the people to choose service to God over all else.
- Deut 30:19, 20 – Moses encourages the people to choose between life and death.
- Exe 18 – an entire chapter about the consequences of choice which ends with the plea, “Repent and live!”