There is not a righteous man on earth who does what is right and never sins - I think it means righteous man could do what is wrong and sin - not unlike David.
Job sinned -
42:3 Therefore have I uttered that which I understood not, Things too wonderful for me, which I knew not..........
42:6 Wherefore I abhor myself, And repent in dust and ashes.