Abu Ayub reported,

When death approached him, he said, "I have kept something from you that I heard from the Messenger of Allah ﷺ. I heard the Messenger of Allah ﷺ say, 'Were it not that you commit sins, Allah would create a people who would sin so that He could forgive them.'"In another wording, "If you had no sins for Allah to forgive, Allah would bring forth a people who had sins, that He might forgive them."

Azami 11413

Sahih

عن أبي أيوب أنه قال

حين حضرته الوفاة: كنت كتمت عنكم شيئا سمعته من رسول الله ﷺ، سمعت رسول الله ﷺ، يقول: لولا أنكم تذنبون لخلق الله خلقا يذنبون يغفر لهم وفي لفظ: لو أنكم لم تكن لكم ذنوب، يغفرها الله لكم، لجاء الله بقوم لهم ذنوب، يغفرها لهم.

الأعظمي 11413صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Repentance and seeking forgiveness
Chapter
Comprehensive and general supplications
Section
Every son of Adam sins, and Allah loves that the son of Adam seeks forgiveness so He forgives him
Numbering
Jami al-Kamil 11413 (2nd edition)
Azami 11413