Rambam (Hil Avodah Zarah ch 4):
והיאך דין עיר הנידחת, בזמן שתהא ראויה ליעשות עיר הנידחת--בית דין הגדול שולחין ודורשין וחוקרין, עד שיידעו בראיה ברורה, שהודחה כל העיר או רובה, וחזרו לעבודה זרה.
אחר כך שולחין להן שני תלמידי חכמים, להזהיר אותן ולהחזירן. אם חזרו ועשו תשובה, מוטב; ואם עמדו באיוולתם, בית דין מצווין לכל ישראל לעלות עליהן לצבא, והן צרין עליהן ועורכין עימהן מלחמה, עד שתיבקע העיר.
The Rambam has a tremendous chiddush that if the residents of an ir hanidachas do teshuvah, the city is exempted from the law of ir hanidachas and is not destroyed. Ra'avad objects and asks how it is possible after hasra'ah has been given and the residents of this city still persisted in doing avodah zarah that teshuvah should still help. If someone, for example, is mechalel Shabbos and is supposed to get a punishment of skilah, beis din does not let the person off the hook just because he professes to have done teshuvah!
The Rogatchover tries to salvage the Rambam by tempering the chiddush. He writes that the Rambam does not mean that through teshuvah the idolators are let off the hook. Rather, all the Rambam means is that the idolators are judged as individuals and are given skilah instead of the city as a whole being treated as an ir hanidachas.
The Kesef Mishna, however, tries to answer the Ra'avad's objection and explain that teshuvah really does work here. He writes that according to the Rambam there was in fact never any formal hasra'ah given. When beis din sends the two messengers the Rambam describes, that is more in the way of a public service announcement, not a warning that meets the technical requirement of hasra'ah given before punishment.
I can't make sense of the Kesef Mishna. When the Ra'avad refers to hasra'ah, he wasn't (b'pashtus) talking about the hasra'ah given by the two talmidei chachamim sent by beis din hagadol, but rather about the earlier hasra'ah given to the ovdei avodah zarah to establish that they were idolators, as the Rambam himself writes:
אין עושין עיר הנידחת, עד שידיחוה מדיחיה בלשון רבים ויאמרו להן נלך ונעבוד, או נלך ונזבח, או נלך ונקטר, או נלך וננסך, או נלך ונשתחווה, או נלך ונקבל באלוה; והן שומעין, ועבדו אותה דרך עבודתה, או באחת מארבע עבודות, או שקיבלו אותה באלוה.
עיר הנידחת שלא נתקיימו בה ובמדיחיה כל התנאים האלו, היאך עושין להן--מתרין ומעידין בכל אחד ואחד שעבד מהן עבודה זרה, וסוקלין אותן כיחידין; וממונם ליורשיהן.
The creation of an ir hanidachas only happens after a majority of the citizens of the city have been given hasra'ah and found to be ovdei avodah zarah. One past the tipping point, there is no turning back.
Be that as it may, it comes out from the Rambam and the Kesef Mishne that there are two major chiddushim here:
1) It is possible for an ir hanidachas to be excused from punishment through teshuvah, unlike all other chayvei misah.
2) According to Ks"M there is no formal hasra'ah needed before the punishment of ir hanidachas is administered unlike other chayvei misah.
The question is why this should be true -- why is the parsha of ir hanidachas different than all other punishments?
Rambam the halachist does not answer the question of "why" in Mishna Torah, but I think he does answer it as a philosopher in Moreh Nevuchim (III:41). The Rambam writes that the the punishment given to the meisit and the ir hanidachas is in a fundamentally different category than all other chayvei misah. These sins are not crimes done in response to temptation or want, but are acts of rebellion against religion itself. The Rambam distinguishes between misah and/or malkos for all other transgressions, which are punishments for the specific act of sin, and misah given to the meisit and the ir hanidachas which is a response to the attitude of defiance and rebellion that motivated the crime.
Returning to the chiddushim of the Rambam here, true, there is no getting out of any punishment of beis din through teshuvah, but the punishment of ir hanidachas is not among the 4 misos of beis din -- it is a unique category of punishment with its own rules. The punishment of ir hanidachas therefore also does not conform to the "usual" requirements of hasra'ah of the other 4 misos beis din.
I thought this was such a nice chiluk that I got greedy and go a step further. The gemara in the beginning of Makkos (2a) writes that the punishment of ka'asher zamam cannot be carried out on witnesses who testify that a kohen married a gerusha because their testimony would make not only the defendent, but also his children, into chalalim. Since the punishment of ka'asher zamam can only be used to disqualify the witnesses, not their children -- "lo, v'lo l'zar'o" -- there can be no ka'asher zamam here and the witnesses get malkos instead.
In order for any testimony to be accepted, it has to be ra'uy l'hazima, possible for the witnesses to be disqualified and punished with hazamah. In the case of testimony about a gerusha, the gemara has a chiddush that malkos can substitute for ka'asher zamam. But, says the Minchas Chinuch, what about witnesses that testify against citizens in an ir hanidachas? Through their testimony, not only is the immediate defendant liable for punishment, but his wife and children would be killed as well as well. Based on the rule of "lo v'lo l'zar'o" we cannot similarly punish children of the witnesses. How then is their testimony ra'uy l'hazamah? (Where witnesses are testifying in a capital case malkos cannot be given as a substitute -- see Tos Makos 2a).
I wanted to use the Rambam's distinction to answer this question. You only need testimony that is ra'uy for hazamah when you are dealing with one of the classical punishments give by beis din -- it's a rule in the function of beis din in kabbalas eidus. But when you are dealing with the punishment of ir hanidachas, a punishment which is categorically different than all other ma'aseh beis din punishments, a sui generis unique type of justice, perhaps the critieria of ra'uy l'hazamah is lifted as well.
My son shot this idea full of holes, starting with the question of why we would need derisha v'chakira at all for witnesses in an ir hanidachas case if my logic is correct. (The whole point of derisha v'chakira b'pashtus is to force the witnesses to specify a date, time, place etc. where the event occurred so their testimony can be impeached by hazamah.) I squirmed and made all kinds of chilukim, but the questions against me stack up higher than my answers. So why did I bother to write this? Because I'm emotially attached to the sevara even if my brain tells me it would be hard to work it out. Maybe someone else can help salvage it.
So how else can you answer the Minchas Chinuch's question? Let's take another case as an example: If witnesses testify that a father and his son violated Shabbos, there is no out because of "lo v'lo l'zar'o." It's only in the kohen case, where the father is the cause (sibah) of the child's punishment, that the din of "lo l'zar'o" comes into play -- not where there are multiple defendants who happen by coincidence to be related and witnesses are testifying against all of them.
By ir hanidachas, it's not the avodah zarah of the father which is the sibah, the cause, of his children being punished -- it's the fact that they live in an ir hanidachas. That is more similar to the shabbos case than the kohen and gerusha case. (See the Steipler in Makkos who says something similar to this, and then goes on to show that the Rishonim did not make this type of chiluk.)