Hadithcore
Musnad Ahmad 2218
sahih

It was narrated from Ibn 'Abbas (رضي الله عنه) that a man from among the Ansar apostatised from Islam and joined the mushrikeen, then Allah revealed the verse:

“How shall Allah guide a people who disbelieved after their Belief and after they bore witness that the Messenger (Muhammad (ﷺ)) is true and after clear proofs had come unto them? And Allah guides not the people who are Zalimoon (polytheists and wrongdoers)" [Al 'Imran 3:86]. His people sent word of that to him; he came back repenting and the Prophet (ﷺ) accepted that from him and let him off.

References1 variant
Arabic/English book
Book 25, Hadith 2218