You're right that Romans 3:28 says ""works of the law,"" but that doesn't help your case, it sharpens Paul's. He's not denying that faith produces works; he's denying that any works (including Mosaic ones) are the ground of justification: ""to the one who does not work but believes - his faith is counted for righteousness"" (Rom 4:5). That's not ""no law‑works but yes other‑works""; that's no works as the basis of justification
James doesn't contradict that—he exposes fake, non‑saving ""faith by itself"" (Jas 2:17), then shows that real faith is completed (brought to its intended expression) by works, not constituted by them: ""faith was working with his works & by works faith was perfected"" (Jas 2:22). The faith is already there; works bring it to maturity & visibility. If works were part of faith’s essence, James couldn't speak of ""faith by itself"" at all.
So the categories stand:
Paul: justified by faith apart from works of the law (Rom 3:28; 4:5).
James: the faith that justifies is never alone; it shows itself by works (Jas 2:18, 22, 24)
Works don't make faith salvific; they show that the faith is the real, God‑given kind. Root & fruit stay distinct.
No it creates a dilemma for you. James says we are saved by works and not with alone. Paul rejected works of the law but encourages people to good works. It's rather plain and simple.