Anas reported that the Messenger of Allah ﷺ had a Persian neighbour who could prepare a good soup. One day he cooked soup for the Messenger of Allah ﷺ and came to him to invite him. The Messenger of Allah asked: ‘And is ʿĀʾishah invited too?’ He replied; ‘No’. So the Messenger of Allah ﷺ said: ‘No, (in declining the invitation)’. The neighbour returned once more and invited him again, and the Messenger of Allah ﷺ asked; ‘Is ʿĀʾishah invited too?’ He replied; ‘No’, and so the Messenger of Allah ﷺ said; ‘No (in declining the invitation)’. He returned a third time to invite him and Allah’s Messenger ﷺ again asked: ‘And is ʿĀʾishah invited too?’ the neighbour replied; ‘Yes’, so the Prophet and ʿĀʾishah made their way until they reached his house.

an-Nawāwī:

As for the second narration about the story of the Persian, then that is another issue all together. It is conceived to mean that there was an excuse that prevented the Prophet ﷺ from the obligation of accepting the invitation. The Prophet had the permissible options which were to either accept or reject the invitation, and since ʿĀʾishah was in a state of hunger or some situation similar, he chose to reject it unless she was invited.

The Prophet ﷺ hated to be singled out for food without her, and this (insisting on ʿĀʾishah’s attendance) is the from the beautiful dealings, rights of companionship and recommended social conduct [that is enjoined by Islam]. So when she was permitted to attend, the Prophet  chose the second permissible option for the sake of a greater benefit. And that was to achieve what he desired of honouring his wife, the fulfilment of good conduct towards her and his compassion in what occurred.