How could Moshe forget laws taught to him by Hashem?
וַיִּשְׁמַ֣ע מֹשֶׁ֔ה וַיִּיטַ֖ב בְּעֵינָֽיו׃
And when Moses heard this, he approved.
Moshe forgot the laws of mourning after becoming angry. From here we see how terrible anger is. (Vayikra Rabbah, Sifra)
In a show of his true humility, Moshe admitted that he was wrong once he heard Aaron’s argument. He also admitted that he was actually taught the same laws by Hashem but that he had forgotten them. (Rashi/Zevachim 101a).
Moshe actually made the following public announcement: “I forgot the law and my brother Aaron taught it to me”.