In Matt 7:23 he says "I never knew you" and that would, to me, mean that they were not believers. Those in John 6:39 were all believers and none of them will ever perish (go to hell) because he will raise all of them up at the last day. So, these in 2 Pet 3:9 who had like precious faith could lose their fellowship with God (perish) but not lose their life in hell.
Matthew 7:21-23 New King James Version (NKJV)
21 “Not everyone who says to Me, ‘Lord, Lord,’ shall enter the kingdom of heaven, but he who does the will of My Father in heaven. 22 Many will say to Me in that day, ‘Lord, Lord, have we not prophesied in Your name, cast out demons in Your name, and done many wonders in Your name?’ 23 And then I will declare to them, ‘I never knew you; depart from Me, you who practice lawlessness!’\
They might have know ABOUT Him and even "accepted Him, but they had not been elected to salvation. It is not important that people say they know Jesus (or think they do) what is important is that Jesus knows them. Knew His elect before the foundation of the world. The bible never says we accept Christ but it does say that Christ accepts us. (in context speaking TO His elect)