A sin caused Adam to feel broken and humble which led to his repentance and success. A good deed caused Satan to be arrogant which led to his destruction. When Adam was created, he was created as a man who was bound to make mistakes. It is human nature to make mistakes and no one is exempt from this. The Prophet peace be upon him said “All of the children of Adam make mistakes, and the best of those who make mistakes are those who repent” (Ibn Majah).
The problem is not in making the mistake, it is the attitude toward good and bad deeds. If one does a good deed they should recognize that it was Allah who guided them to do good. It should not lead to the ironic state of “religious arrogance.” Likewise, if one commits a sin, they should also not beat themselves up and consider themselves worthless, because Allah makes it crystal clear that He will always forgive us as long as we ask to be forgiven.