Indeed, another very important aspect for analysis in the above verse (verse 142 of Surah A’araaf) is this appointment of Harun which Nabi Moosa (a.s) makes as his successor during his 40 day period of seclusion.
According to Afosa.org, the important point to note is that Nabi Moosa (a.s) did not leave his nation without a leader during his absence. So, the question that arises is, how is it possible that our beloved Prophet Muhammad (SAWA) left this Ummah (Muslim nation) without any leader forever or at least explaining the system of appointing a leader.
Our beloved Prophet Muhammad (SAWA) left this world, and the companions were engrossed in deep discussion on how to address this issue of leadership after his demise. This is a very, very important point to ponder.
Therefore, many commentators of the Holy Quran have narrated the very well-known Hadith in reference to this verse, where Rasulullah (SAWA) addressed his cousin/brother, Ali ibn abi Talib (a.s) and told him that he is to Rasulullah (SAWA) like Harun was to Moosa (a.s), except that there will be no Prophet after him (Rasulullah (SAWA)).
As we know, this Hadith is regarded by both Sunni and Shia resources as authentic beyond any question. Bukhari, Muslim, Musnad, ibn Majah have all reported this Hadith as being undeniably authentic, narrated by more than 20 companions (Sahaba).