For Moses writes about the righteousness that is based on the law, that the person who does the commandments shall live by them.
Romans 10:5 ESV
See Leviticus 18:5. There really is a kind of righteousness in the Law. Obedience to the commandments really does bring life. God doesn’t lie. His promises are sure.
The problem is that the blessings and curses of the Law given at Sinai are temporal. While disobedience to the written command causes a person to fall short of God’s glory and warrant eternal damnation, obedience can do nothing at all to enable a person’s eternal life once a single command has been broken. A moment of hatred for a brother costs eternity, and no amount of love will ever restore it.