The gemarra in Shabbos 55a says a rule: אין מיתה בלא חטא, no one dies without having sinned. As an attempt to refute this rule, the gemarra brings a baraisa that says:
מֵיתִיבִי: אָמְרוּ מַלְאֲכֵי הַשָּׁרֵת לִפְנֵי הַקָּדוֹשׁ בָּרוּךְ הוּא: רִבּוֹנוֹ שֶׁל עוֹלָם! מִפְּנֵי מָה קָנַסְתָּ מִיתָה עַל אָדָם הָרִאשׁוֹן? אָמַר לָהֶם: מִצְוָה קַלָּה צִוִּיתִיו וְעָבַר עָלֶיהָ. אָמְרוּ לוֹ: וַהֲלֹא מֹשֶׁה וְאַהֲרֹן שֶׁקִּיְּמוּ כׇּל הַתּוֹרָה כֻּלָּהּ, וּמֵתוּ! אָמַר לָהֶם: ״מִקְרֶה אֶחָד לַצַּדִּיק וְלָרָשָׁע לַטּוֹב וְגוֹ׳״!
The Gemara raises an objection from the following baraita: The ministering angels said before the Holy One, Blessed be He: Master of the Universe, why did You penalize Adam, the first man, with the death penalty? He said to them: I gave him a simple mitzva, and he violated it. They said to Him: Didn’t Moses and Aaron, who observed the whole Torah in its entirety, nevertheless die? The Holy One, Blessed be He, said to them, citing the verse: “All things come alike to all; there is one event to the righteous and to the wicked; to the good and to the clean, and to the unclean; to him who sacrifices, and to him who does not sacrifice; as is the good, so is the sinner; and he who swears, as he who fears an oath” (Ecclesiastes 9:2). Apparently, death is not dependent upon one’s actions. Everyone dies.
The implication is that Moshe and Aharon didn't deserve to die, as they never sinned. Indeed, the gemarra responds that the one who said the rule אין מיתה בלא חטא holds that Moshe and Aharon sinned at the incident with Moshe hitting the rock.
Walking away from this gemarra I would conclude that there's an opinion that Moshe and Aharon never sinned. Nevertheless, the Maharsha and Ben Yehoyada ad. loc. say that everyone agrees they sinned, just that they're disagreeing if the sin they committed was worthy of death.
Does anyone interpret the gemarra like I did? The motivation for the Maharsha and Ben Yehoyada is the incident with Moshe and Aharon is pretty explicit, so it makes sense to say that the gemarra had a different intent. Nevertheless...