Shaykh Saalih al-Fowzaan said:
And it has been reported in an authentic hadeeth, that there are from amongst the students of knowledge those who will be punished before the worshippers of idols.
And they (the students of knowledge) [will] say:
“Starting with us before the worshippers of idols?!”
And [in response] it will be said to them:
“He who knows is not like he who does not know.”
[So] pay attention to this.
And [so], Allaah blesses [the] righteous actions [of those] with little knowledge.
And as for [those with] a lot of knowledge and lack of actions, then indeed it (their knowledge) is [of no value – like] scattered dust – and such a person will be punished before the worshippers of idols.
Note: Righteous actions refers to those actions which are in accordance with the guidance of the Prophet ﷺ and done purely for the Sake of Allaah.