Human righteous deeds are filthy rags

A godly couple was serving the Lord. Being generous and hospitable was their Christian nature. Doing good, helping others, empowering others, and uplifting the marginalized were their priority. On one occasion a widow came to them seeking help. She pretended that she was oppressed, poor, abandoned by their children, and needed help to start a business. She came up with a business proposal and asked the couple to stand a guarantee for her start-up. The couple willingly helped her. After she got the bank loan, she disappeared allowing the godly couple to suffer immensely.
Filthy rags: As the couple cried unto the Lord, God spoke to them. Prophet Isaiah has warned that all righteous acts from a human perspective are filthy rags or even menstrual cloth. (Isaiah 64:6)
Doing Good: The godly couple wanted to do good to all, by all possible means. Disciples are equipped to do all the good work. (II Timothy 3:17) Helping a poor widow is doing good.
Visiting widows: The second reason was the exhortation of James. True spirituality is to visit or care for widows. (James 1:27) Hence, they thought it was God’s will to help her. Lord Jesus reminded his hearers: There were many widows in Israel, but the Lord sent Elijah to a widow at Zarephath. (Luke 4:25,26) God’s will for Elijah to save and provide for that widow.
Joshua too blundered: The Gibeonites presented themselves as weary travelers coming from a distant land. They showed moldy bread and worn-out sandals as evidence. Joshua trusting them made a treaty of peace, without knowing God’s will. (Joshua 9) People who were to be judged by God escaped punishment, because of Joshua’s dependence on his own intelligence.
Discernment: Godly people must be cautious against the traps of Satan. He could give false pride and instigate to do good, which is filthy rags as it is not according to God’s will, plan and purpose. From a human perspective, it would seem to be good, moral, and legal; however, from God’s perspective, they are not right.
Do I discern always to do the righteous will of God?