And this would be something we refer to as "moving the goalposts". Both texts specifically refer to Abraham. Romans says none of his works matter, James says that at least one of his works (the part where Abraham choses the voices in his head over his own son) did matter and that it was in fact a requirement.
Both passages also expressly refer to "works of law", as you put it. The only difference between the two is that the distance between the mention of the law and the mention of the works is a few verses bigger in James. So, if we read the context of Romans, we see that it's one kind of works being talked about and if we ignore the context of James, we could paste a different label on the works and the contradiction is gone.
In any event, the mere fact that we're having this discussion is proof enough that the interpretation of the bible depends on the reader. So ... the bible indeed contains no contradictions, if you make a special effort to avoid seeing contradictions.