The teaching in James 2, that the works spoken of do not justify the man (but are only a fruit and sign of faith), is saying that God judges a man apart from his works. And that God judges a person's works apart from the person.
Ye see then how that by works a man is justified, and not by faith only.
And if ye call on the Father, who without respect of persons judgeth according to every man's work, pass the time of your sojourning here in fear:
The person is judged by God according to their works. We are judged by our works. We are judged as our works are judged.
We are either judged and justified or condemned by God, according to how our works are judged by God, whether being justified unto life, or condemned to death.
Ye see then how that by works a man is justified, and not by faith only.
And if ye call on the Father, who without respect of persons judgeth according to every man's work, pass the time of your sojourning here in fear:
The person is judged by God according to their works. We are judged by our works. We are judged as our works are judged.
We are either judged and justified or condemned by God, according to how our works are judged by God, whether being justified unto life, or condemned to death.