The lesson of the rich young ruler.
He did not understand the sinfulness of man in need of the Savior.
He addressed Jesus as the man as good.
Jesus cited all of the Law regarding man to others less the commandment of "thou shall not covet."
The purpose was the teaching that by the keeping of the Law no one can be justified.
The young man left on his own.
Though this is a digression from the OP, I will address your question, hoping you are serious about the discussion.
James uses the word “justified” in the sense of “validated”.
Abraham’s and Rahab’s faith was validated by their works.
The same is true of Christians today. Our profession of faith is validated the works we do which God has prepared for us to do.
So, the point of Jams argument is the “works” that come after salvation are expected for those who make a profession of faith in Christ and in no way did our “works” prior to salvation cause God to chose us for salvation.
The young man leaves because he is attempting to be justified by the law and Jesus, as Jesus always does, showed that no one is justified by the law. Even though the man had done much to keep the law, he still fell short of justification. Thus he left in sadness.
Humans have always been justified by faith alone. That faith, given to them by God, does the work God ordained them to do.
The reason why Cornelius is given the vision and God brings Peter is precisely because Cornelius had God-given faith to believe under the Abrahamic Covenant, yet he had not heard that the New Covenant had been established for all humanity to receive by God's grace alone.
Cornelius was one of the transitional person's who lived under the Abrahamic Covenant and bridged into the New Covenant.
I believe the rich man must have lied about keeping the Law because this would mean he was sinless. Jesus listened to him He didn't Judge him. The bible clearly states there is no man with out sin there fore the rich man must have been a sinner and certainly lied about keeping the whole Law. Breaking the Law is the only sin under the Law
Shall we look at all of Romans to see if your one sentence is definitive? Or perhaps all of James? It is tiresome to see people plucking sentences and creating theology from them. Moreso, you ignored the whole of what I wrote and plucked a sentence. In short, you have been dishonest.
What's tiresome and soooo redundant on this board is parrots like yourself that pick up a little Reformed Theology, get their brains sucked out and replaced with creeds and solas, never have an original Bible thought of their own after that and attack, insult, and criticize those that do exercise their Right Of Private Judgement.