The Almighty threatens those who disbelieve and continue the disbelief till the end of their life, in the message after they have believed, stating that He doesn’t accept their repentance when death comes to them. Allah (swt) says:
وَلَيْسَتِ التَّوْبَةُ لِلَّذِينَ يَعْمَلُونَ السَّيِّئَاتِ حَتَّىٰ إِذَا حَضَرَ أَحَدَهُمُ الْمَوْتُ قَالَ إِنِّي تُبْتُ الْآنَ وَلَا الَّذِينَ يَمُوتُونَ وَهُمْ كُفَّارٌ ۚ أُولَٰئِكَ أَعْتَدْنَا لَهُمْ عَذَابًا أَلِيمًا
(But repentance is not [accepted] of those who [continue to] do evil deeds up until, when death comes to one of them, he says, “Indeed, I have repented now,” or of those who die while they are disbelievers. For them We have prepared a painful punishment.) (An-Nisaa: 18)
( وَأُولَٰئِكَ هُمُ الضَّالُّونَ … ) (…and they are the ones astray): Those who deviate from the right approach to falsehood.