The Messenger of Allah ﷺ said, "A man may perform the deeds of the people of Paradise, while in the Book he is recorded among the people of the Fire. Then, just before his death, he changes and performs the deeds of the people of the Fire, so he dies and enters the Fire. And a man may perform the deeds of the people of the Fire, while in the Book he is recorded among the people of Paradise. Then, just before his death, he changes and performs the deeds of the people of Paradise, so he dies and enters it."
حدثنا سريج وعفان قالا حدثنا حماد بن سلمة عن هشام بن عروة عن أبيه
أن رسول الله ﷺ قال إن الرجل ليعمل بعمل أهل الجنة وإنه لمكتوب في الكتاب من أهل النار فإذا كان قبل موته تحول فعمل بعمل أهل النار فمات فدخل النار وإن الرجل ليعمل بعمل أهل النار وإنه لمكتوب في الكتاب من أهل الجنة فإذا كان قبل موته تحول فعمل بعمل أهل الجنة فمات فدخلها