Q- Is there a Hadith to the effect that one will not be accountable for the food he cooks for his guests?
To entertain guests is a sublime deed, and is the practice (sunnah) of the Prophets. Rasulullah (sallallahu’alayhi wasallam) has repeatedly emphasised this in several Hadiths.
With regards to the Hadith in your query,
Imam Ghazali (rahimahullah) has cited a similar narration in his Ihya ‘Ulumid Din. However ‘Allamah Subki (rahimahullah) states that he has not found a chain of narrators for this narration. The narration can therefore not be verified and should not be quoted. (Ihya ‘Ulumid Din, vol. 3 pg. 13. Tabaqatush Shafi’iyyah, vol. 6 pg. 308. Also see Al Mughni ‘An Hamlil Asfar, vol. 1 pg. 354)
Furthermore ‘Allamah Suyuti (rahimahullah) has classified the following narration which has a similar meaning as a fabrication: ‘Three people will not be questioned regarding the bounties of food and drink, (the third person being) one who has guests’ (Dhaylul La-Alil Masnu’ah, Hadith: 572)
And Allah Ta’ala Knows best