76:21 Let’s say that a person made a mistake with the intermediate bracha of a Shabbos Amidah between the different prayer services. If he realized his error before saying G-d's Name in the conclusion of the bracha, he should merely go back and recite the appropriate intermediate bracha for this service. If he already said G-d’s Name in the bracha’s conclusion, he should complete the bracha. This fulfills his obligation after the fact since the main theme of the Shabbos intermediate bracha is that G-d should be pleased with our rest, which is the same in all the Shabbos prayer services.
76:22 The rule just stated in 76:21 only applies at Maariv, Shacharis and Mincha. If one recited the intermediate bracha of another prayer service at Musaf, he does not fulfill his obligation because it does not mention the Musaf sacrifice. (He can, however, correct the situation as follows: In the bracha of R’tzei, after the phrase “v’hasheiv es ha’avodah” – “restore the Temple service” – he should add “v’naaseh l’fonecha korban musaf” – “and we will perform the Musaf offering” – Mishnah Brurah 268:16.) Similarly, if he said the intermediate bracha of Musaf during Maariv, Shacharis or Mincha, he does not fulfill his obligation. (If he did this at Shacharis, while he must now recite the proper Amidah, he has fulfilled his obligation to say Musaf, which he would not repeat later – MB 268:17.)