Narrated `Abdullah bin `Amr:
When Allah's Messenger (ﷺ) besieged Taif and could not conquer its people, he said, "We will return (to Medina) If Allah wills." That distressed the Companions (of the Prophet (ﷺ) and they said, "Shall we go away without conquering it (i.e. the Fort of Taif)?" Once the Prophet (ﷺ) said, "Let us return." Then the Prophet said (to them), "Fight tomorrow." They fought and (many of them) got wounded, whereupon the Prophet (ﷺ) said, "We will return (to Medina) tomorrow if Allah wills." That delighted them, whereupon the Prophet (ﷺ) smiled. The sub-narrator, Sufyan said once, "(The Prophet) smiled."
Narrated `Abdullah bin `Umar:
When Allah Apostle was in Ta'if (trying to conquer it), he said to his companions, "Tomorrow we will return (to Medina), if Allah wills." Some of the companions of Allah's Messenger (ﷺ) said, "We will not leave till we conquer it." The Prophet (ﷺ) said, "Therefore, be ready to fight tomorrow." On the following day, they (Muslims) fought fiercely (with the people of Ta'if) and suffered many wounds. Then Allah's Messenger (ﷺ) said, "Tomorrow we will return (to Medina), if Allah wills." His companions kept quiet this time. Allah's Messenger (ﷺ) then smiled.
Narrated `Abdullah bin `Umar:
The Prophet (ﷺ) besieged the people of Ta'if, but he did not conquer it. He said, "Tomorrow, if Allah will, we will return home. On this the Muslims said, "Then we return without conquering it?" He said, 'Then carry on fighting tomorrow." The next day many of them were injured. The Prophet (ﷺ) said, "If Allah will, we will return home tomorrow." It seemed that statement pleased them whereupon Allah's Apostle smiled.
It has been narrated on the authority of Ibn 'Amr who said: The Messenger of Allah (ﷺ) besieged the people of Ta'if, but did get victory over them. He said: God willing, we shall return. His Companions said: Shall we depart without having conquered it? The Messenger of Allah (ﷺ) said: (All right) make a raid in the morning. They did so. and were wounded (with the arrows showered upon them). So the Messenger of Allah (ﷺ) said: We shall depart tomorrow. (The narrator says): (Now) this (announcement) pleased them, and the Messenger of Allah (ﷺ) laughed at (their waywardness).