If we accept that on that day, Jesus will say to some who claimed to call Jesus Lord, Lord, "Depart from Me, I NEVER knew you," that those who went out from us were never Christians in the first place, then we must address why when they made a sincere effort to rely on Jesus, Jesus did not count their faith as righteousness? Jesus explains this in Matthew 13. Some folks, when presented with the gospel of Christ are so hardened, it is as if they never were exposed to the gospel, and so these never embraced Jesus and would never actually consider themselves ex Christians. Now they might claim to be ex-Christians in an effort to undermine Christianity, but in their heart of hearts, they know they were never Christians.
The next group Jesus talks about received the gospel with joy. So it sounded good to them. But the idea in their minds was receiving from God, not giving to God. They did not take Jesus into their hearts, but only into their minds. These would say Jesus failed to keep His promise, rather than recognize they did not love Jesus with all their heart. In Matthew 7, these folks claim to have done this or than "in the name of the Lord" but Jesus NEVER knew them. Scripture does not say, Jesus knew them back when they were professing Christians, but then forgot them when they turned from striving after God.
And the next and last Group Jesus talks about are folks that invited Jesus into their hearts, but they did not clean house. So Jesus shared a place in their heart with other competing treasures of the heart, things of this world and relationships of this world. And over time, these other things choked Jesus out of the person's heart and they too fell away.
So why did not God count the "faith" of these two kinds of embracers of the gospel message as righteousness and spiritually place them in Christ? Because He knows who actually "believes from the heart." We can fool others and we can fool ourselves, but we cannot fool God about our "faith." Our commitment to Christ must be complete, nothing held back, not superficial, i.e. head knowledge rather than heart knowledge, and we must believe in the God who sent Jesus as well as believe in Jesus.