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.
This statement is meant to indicate some of the acts that take the doer out of the fold of Islam according to the Shaafiʻis, namely, approval of disbelief, even if only implicitly. They presented the example of a disbeliever asking a Muslim to teach him Islam and the Muslim does not do so, or a disbeliever asking a scholar to do so and the scholar asks him to wait until he finishes his religious lesson or speech. They held that the Muslim or the scholar in these two examples is declared a disbeliever because of approving that the disbeliever remains so. That is because approval of disbelief is an act of disbelief.
It should be noted, though, that this issue is not subject to a scholarly consensus. In fact, the scholars held different views regarding it, even within the same school of Fiqh. The Hanafi books addressed this case and cited the different scholarly views among the Hanafis. For instance, Majma' Al-Anhur reads, “If a disbeliever came to a Muslim and said to him, 'Teach me about Islam,' and the Muslim man said to him, 'Go to so-and-so,' then he has committed an act that takes him out of the fold of Islam. Another scholarly view holds that this act does not take the doer out of the fold of Islam.”
The two cases mentioned in the question do not fall under this category stated by An-Nawawi. They do not involve a request on part of the disbeliever to learn about Islam. However, the Muslim in the examples mentioned in the question did wrong when he refrained from presenting Islam to this disbeliever out of laziness. He has also denied himself the great rewards for having someone guided to Islam through him. It was narrated by Sahl ibn Saʻd that the Prophet, sallallaahu ʻalayhi wa sallam, when he, sallallaahu ʻalayhi wa sallam, sent him to Khaybar, told him, “Proceed till you approach them, and then invite them to Islam and inform them of their duties towards Allaah which Islam prescribes for them, for by Allaah, if one man is guided to the right path (i.e. converted to Islam) through you, then that would be better for you than red camels (the most precious breed of camels).” [Al-Bukhari and Muslim]
Allaah knows best.