The very commandment that promised life proved to be death to me.
Romans 7:10 ESV
The Law promises life if you obey it and death if you disobey, but the promises are complex and primarily (not totally) aimed at the nation, rather than the individual. The commandments don’t promise eternal life to anyone. That was never their purpose, even though many people mistakenly believe that perfect obedience could earn a person eternal life.
From the ongoing controversy Paul had with the “party of the circumcision”, it’s evident that the Pharisees really did believe that rigid obedience to a set of rules, that were loosely based on Torah, could earn a person a place in the Kingdom of Heaven, but that very belief in the ability of man to earn justification is what brought condemnation instead.