He did not say that either, He said he did not know them, then told them what they really did.
He tells us why they di dnot know them, because they did not believe. (He said it many times)
He is talking to religious wanna bed who refuse to place their faith in him, but instead think their works will mean something. He shuts them down, and says this is how much your works mean to me, I NEVER KNEW YOU.
One who practices unrighteousness HAS NEVER SEEN GOD (1 John) there were not saved one time then lost it.