Did you read how Paul says not having his own righteousness WHICH IS OF THE LAW?
That is about HOW THE JEWS USED TO HAVE to make/work at making THEMSELVES righteous before God, they got circumcised and did the other purification/ceremonial works. THAT IS HOW THE LAW said to do it...
Here Paul speaks of "the works of law" and according to him the law is the knowledge of sin:
"wherefore by works of law shall no flesh be declared righteous before Him, for through law is a knowledge of sin" (Ro.3:20).
It is the moral law which is the knowledge of sin, as witnessed by what Paul said later in the same epistle:
"What shall we say then? Is the law sin? God forbid. Nay, I had not known sin, but by the law: for I had not known lust, except the law had said, Thou shalt not covet" (Ro.7:7).
Paul says that it was the moral law (thou shalt not covet) which resulted in him having the knowledge of sin. So in the following verse when Paul refers to "law" he is referring to the moral law:
"wherefore by works of law shall no flesh be declared righteous before Him, for through law is a knowledge of sin" (Ro.3:20).
Therefore, Paul is saying that no one is declared righteous in the eyes of God by keeping the moral law. then just eight verses later Paul makes it plain that a person's justification is apart from the works of the same law, the moral law:
"therefore do we reckon a man to be declared righteous by faith, apart from works of law" (Ro.3:28).
According to your ideas the "works of law" refers to the ceremonial law but there is no evidence at all that those ordinances resulted in anyone receiving the knowledge of sin. But you will deny what Paul says about the works of law at Romans 3:20 being in regard to the moral law because your denial of the grace of God is based on that discredited idea!
So when Paul says the following about his own righteous the reference is to the moral law, not the ceremonial law, as you imagine:
"And be found in him, not having mine own righteousness, which is of the law, but that which is through the faithfulness of Christ, the righteousness which is of God by faith" (Phil.3:9).