Per Rema 557:1
הגהוהמנהגפשוטשאיןאומריםנחםרקבתפלתמנחהשלתשעהבאבלפישאזהציתואשבמקדשולכןמתפלליםאזעלנחמה (רוקחואבודרהם) מישאכלבט"ביאמרנחםבברכתהמזון (מהרי"ל):
Rema Note: The simple custom is not to say Nachem except during the Minchah prayer on Tisha be-Av, for it was then {in the afternoon} that the fire took hold in the Mikdash, and therefore we pray at this time about the consolation (Rohach, Avudrahum). One who ate on Tisha be-Av, would say "Nachem" {instead of "Rachem"} in Grace after meals (Maharil)
What is the halacha if someone mistakenly said it in Mariv or shachris of Tisha Beav, does shemone esreh have to be repeated?