It is important to know that all of the prophets are infallible (ma’sum, sinless). Any mistakes that prophets may have made are not considered sin, rather they are referred to as ‘Tark Al-Awla’ or ‘Abandoning the Better’ by Muslim scholars. This term means that there were two options, good and better, and the good option was chosen rather than the better one.
Prophets seek forgiveness for their mistakes, as when they see themselves in comparison to Allah almighty, they see even small mistakes as sins.

