Humaid bin Abdur Rahman said that, to refrain from answering due to lack of knowledge about something is more preferable and beloved to me than to make an effort regarding something about which I have no knowledge. (That is, expressing one’s lack of knowledge is better than unnecessary affectation.)
Hadith Takhrijاس روایت کی سند جید ہے، اور [المعرفة والتاريخ 68/2] میں یہ اثر موجود ہے۔
Brief Explanation
(Commentary on Hadiths 147 to 149)
In both these narrations, there is encouragement to refrain from saying anything without knowledge and to avoid affectation (takalluf) when one does not possess knowledge.