Yahweh tells Ezekiel of his role as Israel's watchman, to turn the wicked from his way, since Yahweh has no pleasure in the destruction of the wicked. Then he tells Ezekiel:
"And you, son of man, say to your people, The righteousness of the righteous shall not deliver him when he transgresses, and as for the wickedness of the wicked, he shall not fall by it when he turns from his wickedness, and the righteous shall not be able to live by his righteousness when he sins. Though I say to the righteous that he shall surely live, yet if he trusts in his righteousness and does injustice, none of his righteous deeds shall be remembered . . ."
It seems many of the Jews of Paul's day, with whom he was in dialogue and by whom he was flogged five times, extracted passages like Lev. 18:5 and some passages from Deuteronomy and left behind passages like this one.