Jesus didn’t tell them that they had lost their salvation, but that He NEVER knew them.
They were never saved to begin with.
Nobody loses their salvation.
We don’d get saved until the end. Those that have persevered to the end, the same SHALL be saved.
Too many buy into a “sinner’s prayer” that is nowhere to be found in the word. No prayer saves anyone; the Mikva, (translated Baptism in Greek) which is a process of change and cleansing, and growth, which brings about a new state, which new state maintained through faith, to the end results in salvation at the last trump.