The Torah relates the story of Pinchas, who, after seeing Zimri committing an act of immorality, in front of the leaders of B'nei Yisrael, took initiative and took action. The Torah says:
And, behold, one of the children of Yisrael came and brought to his brethren a Midyanite woman in the sight of Moshe, and in the sight of all the congregation of the children of Yisrael, who were weeping before the door of the Tent of Meeting. (Bamidbar 25:6)
The Midrash Rabbah (Bamidbar Rabbah 20:25) says that the leaders of the generation, after seeing this act of immorality took place before their eyes and the eyes of the whole community, were not able to come up with an immediate response to that situation.
It is simply that, while they were involved in give and take on the matter of whether or not [the culprit] was liable for death, that man (Phinehas) stood up from the midst of the congregation and volunteered [to carry out the sentence].
Rashi explains that Pinchas on the other hand, was reminded of the halacha dealing with all of this.
He saw what was being done and he was thereby reminded of the law on this subject (Sanhedrin 82a).
What whas Pinchas reminded of? Well, the Gemara in Sanhedrin 82a relates the conversation between Pinchas and Moshe Rabbeinu. Pinchas says that Moshe told him, during his descent from Har Sinai, that:
One who engages in intercourse with a gentile woman, zealots strike him?
My question is as follows: the elders had ruach hakodesh, and surely, the leaders of the generation were of great statue. How could they not know how to respond? Didn't Moshe Rabbeinu teach them the same halachos he related to Pinchas (as told in the Gemara in Sanhedrin 82a)? Also, Moshe Rabbeinu, as per the Gemara mentioned above, knew the halachos concerning this matter. Why then, does the Midrash says they did not know how to respond? And how does it come that no one, even Moshe and Aharon, did not respond to this matter?
Are there some great sources/ pearls on this that discuss this?