With regards to the student of knowledge having the humility to tell the people that he does not know the answer to their question, Shaykh Muhammad ibn Saalih al ‘Uthaymeen rahimahullaah comments:
And know for certain that if you open up the arena (when sitting with the people), then questions will come one after the other to you.
However you should beware of answering with that which you do not have knowledge of. Don’t be deceived by the people turning towards you and beginning to ask you (questions), then you reply with that which you do not have knowledge of!
This is a serious issue because Allaah, the Most High, said:
Say (O Muhammad): My Lord has made forbidden al fawaahish (filthy deeds), whether done openly or secretly, sins, transgression without due right, and that you ascribe partners to Allaah for which He has sent down no authority and that you say about Allaah that which you have no knowledge of.
Soorah al A’raaf (7) aayah 33
Do not say about Allaah that which you do not have knowledge of. If you are asked about a matter and you do not know about it, then say to him, “Wait, I will ask about it and I will (then) tell you,” or “I will look it up in the books and (then) I will tell you.”
And do not say that about which you have no knowledge. Indeed the hearing, the sight and the heart – each of these will be questioned by Allaah.
Soorah al Israa- (17) aayah 36
Quoted in Wasaayaa wa tawjeehaat li tullaab il ‘ilm pages 260, translated by Nasser ibn Najam