On Yom Tov, Ḥol Ha-mo’ed, and Rosh Ḥodesh, the Sages ordained that the sanctity of the day be invoked in Birkat Ha-mazon, as eating on these holy days is not the same as eating during the week. It is endowed with sanctity and is a mitzva. This invocation is made through the added paragraph of Ya’aleh Ve-yavo. In it, we ask God to remember us in a good way on this special day, to have mercy upon us, and to save us. This is inserted within the berakha of Boneh Yerushalayim, because it too contains a request for mercy (Berakhot 49a; Shabbat 24a; Tosafot ad loc.).
Since eating bread at a Yom Tov meal is required, one who forgets to say Ya’aleh Ve-yavo during Birkat Ha-mazon has not fulfilled his obligation and must repeat Birkat Ha-mazon. This is the custom of all Ashkenazim and some Sephardim (SA 188:6). Other Sephardim maintain that there is no requirement to eat bread at a Yom Tov meal, and therefore one who forgets Ya’aleh Ve-yavo does not repeat Birkat Ha-mazon. Only if Ya’aleh Ve-yavo was forgotten on the first nights of Pesaḥ or Sukkot would one repeat Birkat Ha-mazon, because everyone agrees that at those meals matza or bread must be eaten.
When Yom Tov or Ḥol Ha-mo’ed coincide with Shabbat, Retzei is recited before Ya’aleh Ve-yavo, because Shabbat is both holier and more frequent (SA 188:5; MB ad loc. 13). If one mistakenly started with Ya’aleh Ve-yavo, he may complete it and then recite Retzei, as the order in which they are said is not critical.
If one begins a meal on Yom Tov before shki’a and finishes it after tzeit, he still says Ya’aleh Ve-yavo in Birkat Ha-mazon. Since he began eating during Yom Tov, he became obligated to say Birkat Ha-mazon with the mention of the festival (Peninei Halakha: Berakhot 4:7 with n. 6; also see 4:8 there).
For women, even within Ashkenazic custom there is room to say that they should not repeat Birkat Ha-mazon (except on the first night of Pesaḥ). There are two possible reasons. First, R. Akiva Eger maintains that women are not obligated in the mitzvot of simḥa and having festive meals on Yom Tov. Second, some maintain that women’s obligation in Birkat Ha-mazon is only rabbinic (see Peninei Halakha: Berakhot 4 n. 5). Nevertheless, those women who do repeat Birkat Ha-mazon have an opinion to rely on (see Harḥavot 1:7:6).
The poskim disagree as to the status of one who is uncertain whether he recited Retzei or Ya’aleh Ve-yavo at a meal in which a definite omission would require repeating Birkat Ha-mazon. Yabi’a Omer 7:28 follows those who maintain that in case of uncertainty one does not repeat, since mentioning the name of the festival is rabbinic, and we are lenient in cases of doubt about berakhot or any other rabbinic rule. Furthermore, it is possible that the sanctity of the day caused the person to remember. MB 188:16 rules that he should repeat Birkat Ha-mazon, since what he most likely said is what he is used to saying, which would not include mention of the festival. This is also the ruling of Birkat Hashem vol. 2 5:18. The bottom line seems to be that if one thinks that he forgot, he should repeat; and if he thinks he did not forget, he should not repeat. If it is 50-50, he should not repeat.
. This is the position of most poskim as well as R. Zvi Yehuda Kook in Olat Re’iya; Yabi’a Omer 10:22; and Peninei Halakha: Berakhot 4:7 in the Harḥavot. At a meal in which omitting Retzei or Ya’aleh Ve-yavo would require repeating Birkat Ha-mazon, if he has already begun the berakha of Ha-tov Ve-hametiv, he must return to the beginning of Birkat Ha-mazon and recite it correctly. It is not sufficient to return to the berakha of Raḥem (SA 188:6; BHL s.v. “le-rosh”). In contrast, if he remembers before beginning Ha-tov Ve-hametiv, the rule is different. Whether or not it is a meal in which omitting Retzei or Ya’aleh Ve-yavo would require repeating Birkat Ha-mazon, he should recite the compensatory blessing: “Blessed are You, Lord our God, King of the universe, Who bestowed festivals upon Israel for celebrating and rejoicing, including this Festival of (Matzot/Shavu’ot/Sukkot/Shemini Atzeret). Blessed are You, God, Who sanctifies Israel and the seasons.” If Yom Tov coincides with Shabbat and one forgets both Retzei and Ya’aleh Ve-yavo but remembers before beginning Ha-tov Ve-hametiv, he should recite: “Blessed…Who lovingly gave Shabbatot to His nation Israel on which to rest as a sign and a covenant, as well as festivals for celebrating and rejoicing, including this Festival of (Matzot/Shavu’ot/Sukkot/Shemini Atzeret). Blessed are You, God, Who sanctifies Shabbat, Israel, and the seasons.” If one does not know the compensatory blessing, he cannot simply recite Ya’aleh Ve-yavo before Ha-tov Ve-hametiv. If it is a meal in which omission requires repeating Birkat Ha-mazon, he must go back to the beginning (Taz; MB 188:17 and BHL ad loc.; Peninei Halakha: Berakhot, Harḥavot to ch. 5, p. 58).
If one forgets Retzei or Ya’aleh Ve-yavo and realizes before saying God’s name at the end of the berakha of Boneh Yerushalayim, he should go back and recite what he left out. If he already said God’s name, many say that he should conclude with the words “lamdeni ḥukekha” (which is the usual procedure for one who mistakenly begins “Blessed are You, God”). If he does not do so but rather completes the berakha of Boneh Yerushalayim, he is obligated to add the compensatory blessing. If he already said the word “boneh,” he should complete the berakha and then recite the compensatory blessing. If he already said the word “barukh” that begins the berakha of Ha-tov Ve-hametiv, according to most poskim he has lost the option of saying the compensatory blessing (MB 188:23; SHT ad loc. 18; BHL s.v. “ad”). Some say that if he is at a meal in which a definite omission would require repeating Birkat Ha-mazon, then as long as he has only said the beginning words of Ha-tov Ve-hametiv, which are the same as the beginning of the compensatory berakha, he can continue and recite the compensatory blessing (Ḥayei Adam; Yabi’a Omer 6:28). All of this is explained in Peninei Halakha: Berakhot 4:8.