All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ʻalayhi wa sallam, is His slave and Messenger.
Such texts are meant to emphasize the stern warning against certain forbidden actions and that the person who commits them deserves punishment and is not one of the absolute believers who have sound faith and who are safe from punishment. This warning is not meant to declare that such a person is a disbeliever and that his actions take him out of the fold of Islam and that he lacks faith altogether (and accordingly shall abide in Hellfire eternally).
Ibn Taymiyyah said in this regard:
“Hence, it becomes clear that the Prophet, sallallaahu ʻalayhi wa sallam, negates the sinner's faith because of the absence of the perfection of faith that is obligatory (al-kamaal al-waajib), even if he has some other parts of faith. Read, for example, the words of the Prophet, sallallaahu ʻalayhi wa sallam, 'He who cheats us is not one of us,' and, 'He who takes up arms against us is not one of us.' The pronoun 'us' in the hadeeth refers to the Prophet, sallallaahu ʻalayhi wa sallam, and the believers around him with perfect faith who deserve the rewards of Allaah without any punishment.”
He also said:
“Every sin of which its perpetrator is warned that he will not enter Paradise, or that he will not smell its fragrance, or that he ‘does not belong to us,’ or that he is a sinner; all such sins are major, grave sins. This is because negating the faith of the doer of such sins and stating that he is not a believer does not mean what the Murji’ites claimed, that ‘he is not one of the best of us,’ because if that sinner gives up the sin, then this does not necessarily mean that he is one of the best of them. Also, it does not mean what the Khawaarij (Kharijites) claimed, that ‘he has become a Kaafir (non-Muslim),’ or what the Muʻtazilites claimed, that ‘he has lost faith altogether and that he shall abide in Hellfire for ever and will not come out of it.’ All these statements are false ones. The truth in this regard is that the believers who deserve Paradise and who will enter it without any punishment are those who fulfill the obligatory duties and shun the prohibitions as due. They are those who are meant when the term 'believers' is used in its absolute sense. So, when someone commits these major sins, he is not one of such believers, for he is liable to be punished for his sins. This is what the scholars mean when they say that (in those texts,) the Prophet, sallallaahu ʻalayhi wa sallam, only means to negate true faith or perfect faith from such sinners, for certainly they do not mean to deny the recommended perfection (al-kamaal al-mustahab) of faith, since the absence of that recommended perfection does not call for dispraise or punishment.” [Briefly excerpted]
Allaah knows best.