The devil....seeking whom he may devour. You might say yes, but the Lord will say NO. The devil can't devour anyone who has the Spirit of God dwelling in them. "Almost" doesn't count. He didn't. He didn't because greater is He that is in you than he that is in the world.
So, you're wrong, and that
doubt (yes, doubt and FEAR) does not come from God who has bought you with great price, paying down an
earnest only God can give (sealed with the Holy Spirit) to prove His commitment. He is able even when we doubt ourselves. If it was up to you and your faithfulness then you would be able to say you had a hand in your salvation. "I kept myself"...."I remained faithful".
Read these verses from Ephesians very carefully, and pray the Lord reveals the wonderful truth found there. These are carefully chosen words that you are forced to ignore by what you have said. All glory for God's grace....all glory will go to the Lord Jesus Christ. No man can say the Lord couldn't have done it without their cooperation. We accept the gift that is freely given. There are no strings attached to God's Grace...and in the ages to come, every being will admit that.
Eph. 2:7 That in the ages to come he might shew the exceeding riches of his grace in his kindness toward us through Christ Jesus. For by grace are ye saved through faith; and that not of yourselves: it is the gift of God: Not of works, lest any man should boast.