Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:49:5

And if they had been patient until you ˹could˺ come out to them, it would have been better for them. But Allah is Forgiving and Merciful.  

And had they been patient (annahum, ‘they’, has independent status, on account of inceptiveness; alternatively, it is said to govern an implied verb such as thabata, ‘had ˹their patience˺ been maintained’) until you came out to them, it would have been better for them; and God is Forgiving, Merciful, to those of them who repent.
القرآن:٤٩:٥

وَلَوْ أَنَّهُمْ صَبَرُوا حَتَّىٰ تَخْرُجَ إِلَيْهِمْ لَكَانَ خَيْرًا لَهُمْ ۚ وَاللَّهُ غَفُورٌ رَحِيمٌ  

{ولو أنهم صبروا} أنهم في محل رفع بالابتداء، وقيل فاعل لفعل مقدر، أي ثبت {حتى تخرج إليهم لكان خيرا لهم والله غفور رحيم} لمن تاب منهم، ونزل في الوليد بن عقبة وقد بعثه النبي ﷺ إلى بني المصطلق مصدقا فخافهم لترة كانت بينه وبينهم في الجاهلية فرجع وقال إنهم منعوا الصدقة وهموا بقتله، فهمَّ النبي ﷺ بغزوهم فجاءوا منكرين ما قاله عنهم.