וְהָיָה֙ בָּעֵ֣ת הַהִ֔יא אֲחַפֵּ֥שׂ אֶת־יְרוּשָׁלִַ֖ם בַּנֵּר֑וֹת וּפָקַדְתִּ֣י עַל־הָאֲנָשִׁ֗ים הַקֹּֽפְאִים֙ עַל־שִׁמְרֵיהֶ֔ם הָאֹֽמְרִים֙ בִּלְבָבָ֔ם לֹֽא־יֵיטִ֥יב יְהוָ֖ה וְלֹ֥א יָרֵֽעַ׃
И будет в то время, что Я буду искать Иерусалим с лампами; И я накажу людей, которые устроились на их осадке, которые говорят в своем сердце:'Господь не сделает добро и не сделает зла.'
Rabbeinu Bahya
It appears to me that when you read the plain text without trying to read between the lines as did the sages of the Midrash, you will come to the conclusion that Moses had not sinned at all with what he asked. There are two reasons for not finding fault with Moses’ question למה הרעותה לעם הזה, “for what purpose did You allow this people to experience a deterioration in their plight instead of redeeming them immediately?” The Torah wanted to inform us that improvements or deteriorations in the fate of the Jewish nation are the result of G’d’s doing, not of someone else’s doing. By his very question, Moses wanted to make it clear that he understood this. After all, evil does originate with G’d though in a more indirect manner than good. Did not Tzefaniah 1,12 admonish the people saying: “I will punish those who say to themselves: ‘the Lord will do nothing good or bad?’” Secondly, If Moses had been under the impression that his question had been sinful, it is hard to understand why he would repeat the same mistake in Numbers 11,11 where he used similar language applying it to his own situation when he asked G’d למה הרעות לעבדך ולמה לא מצתי חן בעיניך, וגו', “why did You do this evil to Your servant; why did I not find favor in Your eyes, etc.”
Moses did commit a sin however when he said in the following verse: “Ever since I have come to Pharaoh to speak in Your name, he has done evil to this people, but You did not rescue Your people.” In response to this criticism of G’d’s methods, G’d told Moses that he would indeed shortly observe how He would make good on His promise against Pharaoh and the Egyptians; He implied that Moses would not become a witness to how G’d would make good on His promise to bring the Israelites to the Holy Land. The lesson G’d was going to teach Pharaoh would be that he himself would ask the Jewish people to leave. They would not escape but Pharaoh would actually expel them.
Moses did commit a sin however when he said in the following verse: “Ever since I have come to Pharaoh to speak in Your name, he has done evil to this people, but You did not rescue Your people.” In response to this criticism of G’d’s methods, G’d told Moses that he would indeed shortly observe how He would make good on His promise against Pharaoh and the Egyptians; He implied that Moses would not become a witness to how G’d would make good on His promise to bring the Israelites to the Holy Land. The lesson G’d was going to teach Pharaoh would be that he himself would ask the Jewish people to leave. They would not escape but Pharaoh would actually expel them.