So the question is two fold.
Jesus at the day of judgement is saying, you evil doers I never knew you. Now this is a group of people who justify themselves based on spiritual works ie miracles, casting out demons and Jesus says He does not know them.
Jesus is saying how you are inside, what you do and why matters.
John is saying walking with Christ means you walk in righteousness, and even if you stumble he is there to pick you up. The basis is in the goal the walk. Now how far and when in sanctification terms we obtain this walk, we do not know, but John is declaring we can expect it.
Hyper-grace is claiming this is impossible. So the view is you never need to walk like this, it is only Jesus and His righteousness that John is talking about. But that is just insane and meaningless. It is stripping out all the meaning of 1 John.
Either you accept walking in maturity in Christ is walking in the light, walking without sin. Now walking without sin means all sin to date is dealt with, you are cleansed and you walk without sin in the Lord. Have you ever ridden a bike. When you can ride well you do not expect to fall off, but it happens. Johns language is saying you can ride the bike and as a christian should be able to ride righteousness well. It is that simple. If you cannot ride well, you do not know the Lord.
This is not an idealised view that there is no risk you will not sin. As Jesus says in the Lords prayer,
"Lead us not into temptation"
It is all that simple and not even close to the extremes put forward by some here.
Failure is the enemies work to steal our inheritence in walking with Jesus.