In context, Jesus is referring primarily to false prophets. Using language drawn from Psalm 6:8,1 he makes it clear that false prophets will not deceive him. They may deceive God’s people for a time, but they will not deceive the Lord, and they will not be part of his kingdom. Implicit in his words is the idea that those who follow false prophets will also be excluded from the kingdom.2
23 And then will I declare to them, ‘I never knew you; depart from me, you workers of lawlessness.’