During his sermon on the mount, Jesus said, Not every one that saith unto me, Lord, Lord, shall enter into the kingdom of heaven; but he that doeth the will of my Father which is in heaven. Many will say to me in that day, Lord, Lord, have we not prophesied in thy name? and in thy name have cast out devils? and in thy name done many wonderful works? And then will I profess unto them, I never knew you: depart from me, ye that work iniquity.Matthew 7:21-23
This is a well-known passage, as every denomination says that every other denomination will hear these words from Jesus. Yet Jesus says to that cursed group, depart from me, ye that work iniquity.
The word 'iniquity' in the Greek is ἀνομίαν (anomia, Strong's G458). The meanings are specific to the law: "illegality," "violation of law," or "transgression of the law." Jesus never said the law would go away,(Quite the opposite, see Matthew 5:17-20, Luke 16:17.) but said to follow it.(Matthew 19:17.)
It is Paul who states, several times, that we are not under the law. For sin shall not have dominion over you: for ye are not under the law, but under grace.Romans 6:14 For Christ is the end of the law for righteousness to every one that believeth.Romans 10:4 But before faith came, we were kept under the law, shut up unto the faith which should afterwards be revealed. Wherefore the law was our schoolmaster to bring us unto Christ, that we might be justified by faith. But after that faith is come, we are no longer under a schoolmaster.Galatians 3:23-25 But now in Christ Jesus ye who sometimes were far off are made nigh by the blood of Christ. For he is our peace, who hath made both one, and hath broken down the middle wall of partition between us; having abolished in his flesh the enmity, even the law of commandments contained in ordinances; for to make in himself of twain one new man, so making peace.Ephesians 2:13-15
So, despite billions of people doing good in the name of Jesus, because they believe the law to be abolished and do not even think to follow it, Jesus will say those sad words to them. I never knew you: depart from me, ye that work iniquity.
This is actually what is at stake with Paul. If we follow Paul, we work without the law. Jesus does not recognize this work, and so all good we may do is of null effect in heaven.