You have the WRONG INTERPRETATION again. James DOES NOT CONTRADICT Eph. 2:8-9, and Titus 3:5-7.
Of course James didn't contradict Ehesians 2 or Titus 3 or Romans 4.
Scripture does not contradict scripture.
In Romans 4, Paul is referring to the works of the law, in which by keeping the works of the law, some thought they could "earn" their salvation.
27 Where is boasting then? It is excluded. By what law? Of works? No, but by the law of faith. 28 Therefore we conclude that a man is justified by faith apart from the deeds of the law. 29 Or is He the God of the Jews only? Is He not also the God of the Gentiles? Yes, of the Gentiles also, 30 since there is one God who will justify the circumcised by faith and the uncircumcised through faith. 31 Do we then make void the law through faith? Certainly not! On the contrary, we establish the law.
What then shall we say that Abraham our father has found according to the flesh? 2 For if Abraham was justified by works, he has something to boast about, but not before God. 3 For what does the Scripture say? “Abraham believed God, and it was accounted to him for righteousness.” 4 Now to him who works, the wages are not counted as grace but as debt.
5 But to him who does not work but believes on Him who justifies the ungodly, his faith is accounted for righteousness,
Romans 3:27-4:5
The works James is referring to is the obedience of faith, not the works of the law or good works of righteousness.
Was not Abraham our father justified by works when he offered Isaac his son on the altar? James 2:21
This is called the obedience of faith -
But now is made manifest, and by the scriptures of the prophets, according to the commandment of the everlasting God, made known to all nations for the obedience of faith: Romans 16:26
- the commandment of the everlasting God, made known to all nations for the obedience of faith:
Remember how the woman with the issue of blood was healed.
The obedience of faith: Doing what the Lord speaks to us to do.
JPT