Any isolated narration attributed to the Prophet Muhammad (sws) should never be used as a souce of law and in an absolute sense, unless it’s validity has been studied in the light of Quran and Sunnah and all related narrations have been studied in this regard.
As a refresher, please refer to the following Principles of Understanding the Hadith:
Discussion 56230
In Quran, the matter of two Muslim Groups fighting has been disussed in Chapter 49:
وَإِنْ طَائِفَتَانِ مِنْ الْمُؤْمِنِينَ اقْتَتَلُوا فَأَصْلِحُوا بَيْنَهُمَا فَإِنْ بَغَتْ إِحْدَاهُمَا عَلَى الْأُخْرَى فَقَاتِلُوا الَّتِي تَبْغِي حَتَّى تَفِيءَ إِلَى أَمْرِ اللَّهِ فَإِنْ فَاءَتْ فَأَصْلِحُوا بَيْنَهُمَا بِالْعَدْلِ وَأَقْسِطُوا إِنَّ اللَّهَ يُحِبُّ الْمُقْسِطِينَ إِنَّمَا الْمُؤْمِنُونَ إِخْوَةٌ فَأَصْلِحُوا بَيْنَ أَخَوَيْكُمْ وَاتَّقُوا اللَّهَ لَعَلَّكُمْ تُرْحَمُونَ )
And if two parties or groups among the believers start fighting, then make peace between them both. But if one of them outrages against the other, then fight you against the one which outrages until it complies with the decision of God. Then if it complies, make reconciliation between them justly, and be equitable because God loves those who are the equitable. The believers are brothers to one another. So make reconciliation between your brothers, and fear Allah that you may receive mercy. (49:9-10)
If we look at other Ahadith touching similar topic, we come to know that these ahadith are discussing such application in the presence / absence of Nazm-e-Ijtimae of Muslims (Established State). Following are other Ahadith which give us a complete picture in this regard:
مَنْ رَأَى مِنْ أَمِيرِهِ شَيْئًا يَكْرَهُهُ فَلْيَصْبِرْ عَلَيْهِ فَإِنَّهُ مَنْ فَارَقَ الْجَمَاعَةَ شِبْرًا فَمَاتَ إِلَّا مَاتَ مِيتَةً جَاهِلِيَّةً
He who sees something despicable in his ruler should bear it, for he who even slightly disassociates himself from the state authority and dies in this condition shall die the death of jahiliyyah. (Al-Bukhari, Al-Jami‘ al-sahih, 1217, (no. 7054).
On one occasion, regarding this issue, the Prophet (sws), on these very grounds, is reported to have told Hudhayfah (rta): تَلْزِمُ جمَاعَةَ اْلمُسْلِمِينَ وَ اِمَامَهُم ([in such a state of chaos], you should remain attached to the state authority and to the ruler of the Muslims. Hudhayfah (rta) said: If they have no (such thing as the) main body and have no leader? Prophet (sws) said: Separate yourself from all these factions, though you may have to eat the roots of trees (in a jungle) until death comes to you and you are in this state.(https://sunnah.com/muslim:1847a).
It has been narrated on the authority of Arfaja who said: I have heard the Messenger of Allah (ﷺ) say: Different evils will make their appearance in the near future. Anyone who tries to disrupt the affairs of this Umma while they are united you should strike him with the sword whoever he be. (If remonstrance does not prevail with him and he does not desist from his disruptive activities, he is to be killed.) (https://sunnah.com/muslim:1852a)
Prophet (sws) also said: He who swears allegiance to a Caliph should give him the piedge of his hand and the sincerity of his heart (i. e. submit to him both outwardly as well as inwardly). He should obey him to the best of his capacity. It another man comes forward (as a claimant to Caliphate), disputing his authority, they (the Muslims) should behead the latter. (https://sunnah.com/muslim:1844a)
And
It has been narrated on the authority of Aba Sa’id al-Khudri that the Messenger of Allah (ﷺ) said: When oath of allegiance has been taken for two caliphs, kill the one for whom the oath was taken later. (https://sunnah.com/muslim:1853)
In Quran, it has been ordered to fight against the Muslim group if that group acts outrageously and injustly. Similarly, In some Ahadith, as you can see, it has been ordered to kill another Muslim if he tries to disrupt Nazam-i-Ijtimae of Muslims. But in the absence of such Nazam-e-ijtimae and the presence of Choas, Prophet (sws) forbade killing of other Muslims (as mentioned in the Hadith quoted by you and the one narrated by Hudhayfah (rta)). Regarding groups of Sahaba including Ali (rta), Muawiya (rta) and Aisha (rta), they were all seeing the same situation with different perspectives; and one group believed the other to be acting outrageously and injustly, therefore, in their ijtihaad, they were in all honsety trying to do the right thing. Some individual Sahaba on the other hand, thought that situation to be the one without Nazam-e-iIjtimae of Muslims and therefore, stayed away from that chaos and according to them, the Hadith quoted by you in the question had to be applied in that situation.