Where there is law there is judgment and condemnation, this is why Paul said to the Galatians,
"Tell me that you desire to be under the law, do you not hear the law?" Galatians 4:21.
The law demands perfection, no one has it to offer, simply because, "There is none righteous, no, not one" Romans 3:10. "For all have sinned and come short of the glory of God" Romans 3:23.
Do you want to be judged by the law? Do you have a righteousness that will satisfy the demands of God's Holy Law.
This is why Paul said, "That I might be found in him (Jesus) not having my own righteousness that is of the law, but that which is of the faith of Christ, the righteousness which is of God by faith" Philippians 3:9.
The only righteousness that God will accept in the judgment is the righteousness which is of God by faith. All righteousness that is of the law will perish.
The work we do is because we were made righteous...not in order to become righteous...
Israel was saved from slavery first and then given the law...