One of the great beauties of scripture is that it pulls no punches. The Bible not only shows the mercy, justice, and kindnesses of a person, but also their faults and foibles. King David is portrayed as a murdering adulterer and a pretty poor parent to boot. Job accuses God of being less than fair. And Abraham is no different from any of the other great biblical characters.
Righteousness is the aspiration.
Life is the reality. Often their choices cost them dearly, while at other times we just don't know what it cost them. Certainly their poor choices brought them guilt and often shame. And that's where God comes in. The neat thing about God is it's God who decides about righteousness.