Allah has destined for man to fall into error to remind him of his weakness and the perfection of his Lord. If man was to always be correct, he would forget his Lord and deny His existence, but Allah causes him to fall into error so that he turns to Him, thus not becoming arrogant nor transgressing.
يقدّر الله الخطأ على الإنسان ليذكّره بضعفه وكمال ربه، ولو أصاب الإنسان دوماً لنسي ربه وألحد، ولكن يوقعه ليلتفت إليه فلا يتكبر ولا يطغى