Isaiah says your righteousness is filthy rags.
Paul says that your righteousness comes short of the glory of God.
John says that you are deceiving yourself.
God does not say that our obedience is as a filthy rag.
The Jews used to have to give BLOOD offerings for their sins---so that they could make themselves RIGHTEOUS BEFORE GOD.
God did NOT like it that the Jews would sin, give a BLOOD SIN OFFERING BUT NOT REALLY BE SORRY FOR THEIR SINS, their sins that they kept doing.
Those BLOOD offerings became as FILTHY THROW AWAY, BLOODY MENSTRUAL RAGS to the Lord.
Read Isaiah 1
Isaiah 1:13 Stop bringing meaningless offerings!
That is what is said by God about the offerings the people were bringing.
Is God putting down the law He gave about bringing offerings?
No, of course not, God is not putting down the law He gave.
God is putting down the offerings that are given by those who have not stopped sinning.
God is putting down the offerings given by people whose hearts are not right.
Read how God, who gave the law to Moses, is complaining that the Jews who were doing the law were doing it without a true heart of remorse from sin.
Isaiah 1:14 Your New Moon feasts and your appointed festivals
I hate with all my being.
They have become a burden to me;
I am weary of bearing them.
15 When you spread out your hands in prayer,
I hide my eyes from you;
even when you offer many prayers,
I am not listening.
Your hands are full of blood!
16 Wash and make yourselves clean.
Take your evil deeds out of my sight;
stop doing wrong.
Isaiah 16 Wash and make yourselves clean.
Take your evil deeds out of my sight;
stop doing wrong.
17 Learn to do right; seek justice.
Defend the oppressed.
Take up the cause of the fatherless;
plead the case of the widow.
18 “Come now, let us settle the matter,”
says the Lord.
“Though your sins are like scarlet,
they shall be as white as snow;
though they are red as crimson,
they shall be like wool.
19 If you are willing and obedient,
you will eat the good things of the land;
20 but if you resist and rebel,
you will be devoured by the sword.”
For the mouth of the Lord has spoken.