Paul said in galations righteousness could never come from the law
What bible are you reading?
God’s righteousness is through the faith of Christ. This righteousness was not available to those OT saints.
Romans 3
20 Therefore by the deeds of the law there shall no flesh be justified in his sight: for by the law is the knowledge of sin.
21
But now the righteousness of God without the law is manifested, being witnessed by the law and the prophets;
22
Even the righteousness of God which is by faith of Jesus Christ unto all and upon all them that believe: for there is no difference:
23 For all have sinned, and come short of the glory of God;
24 Being justified freely by his grace through the redemption that is in Christ Jesus:
25 Whom
God hath set forth to be a propitiation through faith in his blood,
to declare his righteousness for the remission of sins that are past, through the forbearance of God;
26
To declare, I say, at this time his righteousness: that he might be just, and the justifier of him which believeth in Jesus.