If one said Ya’aleh Veyavo when it wasn’t Rosh Chodesh, does he need to repeat Shmoneh Esrei?
If one thought it was Rosh Chodesh when it really wasn’t, and mentioned yaleh vyavo in shmoneh esrei, does he need to repeat shmoneh esrei?
There is a machlokes regarding this.
In practice, during the week, one should finish shmoneh esrei and daven a tefillas nedava.
However, on Shabbos (or Yom Tov), when a tefillas nedava is not said, if they have not finished the bracha of “hamachazir shchinoso l’tzion”, they should go back to the beginning of the bracha and repeat it. Even if they have already said the name of Hashem at the conclusion of the bracha, they should conclude למדני חוקיך and repeat the bracha.
שוע”ר סי’ קח סי”ח. וראה אצלנו בקיצור דיני שכחה וטעות בתפילות סוכות ש”ע וש”ת ובהערה יד.