Our Gemara on Amud Beis discusses the power of the prophet to temporarily supersede a Torah law. That is, even though no prophet after Moshe can change the Torah on a permanent basis, for a particular need of the moment and through prophetic sanction, a law can be suspended or enacted.
A lesser known idea related to this is a principle from the Sefer Haikkarim (III:18). This idea only applies to Torah laws from Moshe, however the portion of the Torah heard by the Jewish people directly from God, that is the first two commandments, cannot be suspended even temporarily. This is why a prophet can never suspend the prohibitions of idolatry, as it is from the first two commandments (see Rambam, Laws of Foundations of the Torah (9:1-3).
The Yismach Moshe V‘eschanan 23:1 applies this concept in a derush about the exchange between Moshe, the Jewish people, and God after the first two commandments. As is described in Devarim, (5:19-26), the Jewish people asked Moshe to receive the Torah, instead of them hearing it directly. According to the Midrashic interpretations, the first two commandments were heard by the Jewish people directly, and it was so overwhelming, they died each time and had to be revived. Hence, they asked for more bearable alternative. (See Shabbos 88b, and Makkos 23b-24a.). Hashem’s response to this request was, “May they always be of such mind, to revere Me and follow all My commandments, that it may go well with them and with their children forever.”
Yismach Moshe’s derash is as follows. Hashem was aware that due to various sins and shortcomings on the part of the Jewish people, they would not be able to withstand an enactment of Torah that could not be suspended or altered at times. Therefore, it was necessary that the rest of the Ten Commandments not be heard directly from God. Hashem’s response, is a lament, “If only the Jews could be consistently on this high level.” Then they could bear to hear all the commandments directly from me. But since they cannot, they will need to have this buffer, and allow for temporary adjustments when the prophets guide them as such.
Let us think about the philosophical underpinnings of Sefer Haikkarim’s principle. I believe the reasoning is that since God is eternal and unchanging, a direct encounter with His will, would necessitate transmission of a version of the Torah that would be utterly inflexible. However, once it came through a prophecy, even Moshe’s prophecy, it already began the process of human engagement. That form of expression of Torah is subject to human process and needs. Therefore, that manifestation of Torah could be temporarily modified by a prophet. For more on what this means, see Psychology of the Daf Yevamos 35.