King David and King Saul made mistakes that they were not aware of. The prophets came and told them about their sins. The difference between the two was repentance. David had a teachable heart while Saul could not repent before God. He followed his own ways.
God allows error, it is how we shuv / repent /turn back to God that makes the difference.
this is absolute rubbish...David Killed Bath-Sheba's husband to hide his fornication and he knew what he did he even said as much in Psalm 51...