Adi bin Adi reported,

I heard al-Urs, who was among the companions of the Messenger of Allah ﷺ, say, "I heard the Messenger of Allah ﷺ say, 'A servant may perform the deeds of the people of the Fire, then a path from the paths of Paradise is presented to him and he follows it until he dies upon it, and that is because of what was decreed for him. And a man may perform the deeds of the people of Paradise for a stretch of his life, then a path from the paths of the people of the Fire is presented to him and he follows it until he dies upon it, and that is because of what was decreed against him.'"

Azami 1048

Sahih

عن عدي بن عدي قال

سمعت العرس- وكان من أصحاب رسول الله ﷺ- يقول: سمعت رسول الله ﷺ يقول: إن العبد ليعمل بعمل أهل النار، ثم تعرض له الجادة من جواد الجنة فيعمل بها حتى يموت عليها، وذلك لما كتب. وإن الرجل ليعمل بعمل أهل الجنة البرهة من دهره، ثم تعرض له الجادة من جواد أهل النار فيعمل بها حتى يموت عليها، وذلك لما كتب عليه.

الأعظمي 1048صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Belief in the divine decree and predestination
Section
Actions are judged by their endings
Numbering
Jami al-Kamil 1048 (2nd edition)
Azami 1048