The Gemara (Taanis 28b) asks why we fast on 17 Tammuz if in Sefer Yirmiyahu it says that the walls of Yerushalayim were breached on the 9th of Tammuz and not on the 17th. The Gemara answers that the walls were breached on the 9th during Churban Bayis Rishon and on the 17th during Churban Bayis Sheni. Since we are in Galus from Churban Bayis Sheni, we fast on the 17th.
The Yerushalmi, however, says that according to one opinion, even during Bayis Rishon the walls were breached on the 17th,l but due to all the turmoil during that difficult period, they erred in calculating the exact date. In either event, says the Yerushalmi, everybody agrees that there were 21 days between the breaching of the walls and the destruction of the Bais HaMikdash. Accordingly, says the Yerushalmi, one opinion would place the date of the Churban on Rosh Chodesh Av in accordance with a pasuk in Yechezkel.
The Chasam Sofer asks how Yirmiya HaNavi could have possibly erred when writing Tanach. Moreover, how could Yechezkel who was sitting peacefully in Bavel at the time err in the marking the day of the Churban as 1 Av? There was no turmoil in Bavel to blame it on. He answers that the day after the Churban (10 Av) was referred to as “1 Menachem Av”; since the Churban was a kapara for their aveiros, it was considered a new beginning. That is why Yechezkel’s nevuah refers to the date 1 Av. However the people of Bavel didn’t understand the concept that the Churban can start a new beginning. Therefore, they took Yechezkel at his word. Since they knew that the walls were breached exactly 21 days before they placed that date at 9th of Tammuz.
When a refugee from Yerushalayim arrived in Bavel on the 5th of Teves and reported the dates as 17th of Tammuz and 9th of Av, the people didn’t believe him and trusted their understanding of Yechezkel’s nevuah. Therefore, they took the liberty of amending Sefer Yirmiyahu, sure that their dates were the accurate ones.