A believer may indeed be punished for his sins.
He said, “A believer is the one who, through his faith, will enter Paradise, yet he may first be chastised in the Fire for the offenses he committed.”
I asked, “If someone says, ‘I belong to the people of the Fire,’ what then?”
He answered, “He is lying; he has no knowledge of that, and he has despaired of Allah’s mercy, exalted is He. Abū Ḥanīfah—may Allah have mercy on him—said: One ought to say, ‘I am truly a believer,’ for he does not doubt his own īmān (faith).”
I then inquired, “Is his faith like the faith of the angels?”
He replied, “Yes.”
I continued, “And even if his deeds fall short, is he still a genuine believer?”
Thereupon he narrated to me the report of Ḥārithah: the Prophet ﷺ said to him, “How did you awaken?” He replied, “I awoke as a true believer.”