It was taught in the Tosefta of Ketubot [Chapter 2] and in the Yerushalmi there: Witnesses who testified, whether to declare impure or to declare pure, to distance or to draw near, to forbid or to permit, to exempt or to obligate—as long as their testimony has not been examined in beit din, if they said "we are liars," they are believed. Once their testimony has been examined in beit din, if they said "we are liars," they are not believed. And in the Yerushalmi it concludes regarding this that they treated witnesses signed on a document as if their testimony had been examined in beit din. And so wrote the Rambam in Chapter 3 of Edut and the Tur in this siman. Our teachers, the authors of the Shulchan Aruch, wrote: After the witness has testified in beit din, and it is after the time of "within the duration of a speech," he cannot retract. How so? If he said, "I was mistaken," "I was inadvertent and I remembered that the matter is not so," or "I did it out of fear," they do not listen to him, even if he gave a reason for his words. Thus far their words. And the reason they did not write "after their testimony was examined in beit din" is because monetary laws do not require derishah and chakirah, as will be explained in siman 30. Therefore, after they have testified, their testimony is completed and they cannot retract. However, in capital cases or fines, which require derishah and chakirah, they can retract even after the delivery of their testimony if the derishah and chakirah have not been completed. All of this we learned from the verse "if he does not tell," for once he has told, he cannot return and tell again, as one "telling" is written in the verse and not two "tellings" [Rashi there 18b]. And it implies that regarding a "telling" that has utility the verse wrote, which is in beit din, a place where they receive testimony. Therefore, in everything they spoke outside of beit din, they can retract; but from the time they spoke in beit din and their testimony was completed, they cannot retract. Within the duration of a speech they can retract, for in the entire Torah, "within the duration of a speech" is like the speech itself. The first witness can retract even within the duration of the speech of the second [Sma], because the two witnesses are considered as one. This is specifically when the second testified his testimony within the duration of the speech of the first; but if he testified after the duration of the speech of the first, they are not considered as one, and the first cannot retract after his own duration of a speech [Urim VeTummim]. The same applies to three witnesses. As for that which is said in the Yerushalmi, that they treated witnesses signed on a document as if their testimony had been examined in beit din—meaning that they cannot retract—this is specifically when they recognize their signatures, as will be explained in siman 46 with the help of Heaven. It implies from the wording of the Yerushalmi that it is a rabbinic enactment. Even though in our Talmud it is explained [that by Torah law] witnesses signed on a document are as if their testimony was examined in beit din, and the authentication of the document is rabbinic, it is possible that documents of acquisition and documents of divorce and betrothal, which the Torah commanded regarding them and we do not find that it required authentication, this is from the Torah like testimony examined in beit din; on the contrary, the authentication is rabbinic. But documents of evidence, such as one who borrows money and gives the lender a document so that he will not deny it, such a document has no basis in the Torah at all. And the document of Jeremiah the Prophet [32], even though it is written therein "so that they may last many days," implying it should stand as evidence, it was a document of acquisition as is explicit there, and incidentally he gave him good advice that the document should be preserved for a long time [Gittin 22b]. Therefore, all documents of evidence are a rabbinic enactment, that once they are authenticated they cannot retract. [And the Yerushalmi and the Bavli do not disagree, and from this is a great proof for the Rambam, of blessed memory, in Chapter 3 of Edut, that documents are rabbinic, and his intention was for documents of evidence, as I wrote in the previous siman, section 17. And you should precisely note that at the beginning of Gittin, which deals with a get, the Talmud says "witnesses etc. and it is the rabbis who required authentication," see there, for a get is from the Torah; but in Ketubot 18b, the Talmud does not use this wording, because it deals with a document of evidence, and its essence is rabbinic according to the opinion of the Yerushalmi].
תניא בתוספתא כתובות [פ"ב] ובירושלמי שם העדים שהעידו בין לטמא בין לטהר לרחק ולקרב לאסור ולהתיר לפטור ולחייב עד שלא נחקרה עדותן בב"ד אמרו בדאין אנו הרי אלו נאמנין משנחקרה עדותן בב"ד אמרו בדאין אנו אינן נאמנים ובירושלמי מסיים על זה דעשו עדים החתומים על שטר כמי שנחקרה עדותן בב"ד וכ"כ הרמב"ם בפ"ג מעדות והטור בסי' זה ורבותינו בעלי הש"ע כתבו אחר שהעיד העד בב"ד והוא לאחר כדי דיבור אינו יכול לחזור בו כיצד אמר מוטעה הייתי שוגג הייתי ונזכרתי שאין הדבר כן לפחדו עשיתי אין שומעין לו אפילו נתן טעם לדבריו עכ"ל וזה שלא כתבו אחר שנחקרה עדותן בב"ד משום דדיני ממונות לא בעי דרישה וחקירה כמו שיתבאר בסי' ל' ולכן אחר שהעידו נגמרה עדותן ואין יכולין לחזור בהן אבל בד"נ או קנסות שצריך דרישה וחקירה יכולים לחזור בהם גם אחר הגדת עדותם אם לא נגמרה הדרישה והחקירה וכל זה למדנו מקרא דאם לא יגיד דכיון שהגיד שוב אינו חוזר ומגיד דהגדה אחת כתיב בקרא ולא שני הגדות [רש"י שם י"ח:] ומשמע דאהגדה שיש בה תועלת כתב קרא דהיינו בב"ד מקום שמקבלים עדות ולכן בכל מה שדברו חוץ לב"ד יכולים לחזור בהם ומשדברו בב"ד ונגמרה עדותם אין יכולים לחזור בהם ותוך כדי דיבור יכולים לחזור בהם דבכל התורה תוך כ"ד כדיבור דמי והעד הראשון יכול לחזור אף תוך כדי דיבור של השני [סמ"ע] מפני ששני העדים כאחד הם נחשבים ודווקא כשהשני העיד עדותו תוך כ"ד של הראשון אבל אם העיד לאחר כ"ד של הראשון אין נחשבים כחד ואין הראשון יכול לחזור בו אחר כדי דיבור של עצמו [או"ת] וה"ה בג' עדים וזה שאומר בירושלמי עשו עדים החתומים על השטר כמי שנחקרה עדותן בב"ד ור"ל דאין יכולין לחזור בהן זהו דווקא כשמכירין חתימתן כמו שיתבאר בסי' מ"ו בס"ד ומשמע מלשון הירושלמי דתקנתא דרבנן היא ואע"ג דבש"ס שלנו מבואר [דדבר תורה] עדים החתומים על השטר כמי שנחקרה עדותן בב"ד וקיום השטר הוא מדרבנן אפשר דשטרי קניין ושטרי גיטין וקדושין דהתורה צותה עליהם ולא מצינו שהצריכה קיום זהו מן התורה כמי שנחקרה עדותן בב"ד ואדרבא הקיום הוא מדרבנן אבל שטרי ראיה כגון הלוה מעות ונותן להמלוה שטר שלא יכפור בו אין לשטר זה עיקר מן התורה כלל ושטר של ירמיה הנביא [ל"ב] אף דכתיב ביה למען יעמדו ימים רבים ומשמע דיעמוד לראיה שטר מקנה היה כמפורש שם ודרך אגב נתן לו עצה טובה שיתקיים השטר זמן רב [גיטין כ"ב:] ולכן כל שטרי ראיה הוה תקנתא דרבנן דמשנתקיימו אין יכולים לחזור בהם [ואינו חולק הירושלמי והבבלי ומזה ראי' גדולה להרמב"ם ז"ל בפ"ג מעדות דשטרות הם מדרבנן וכוונתו לשטרי ראי' וכמ"ש בסי' הקודם סעי' י"ז ותידוק דבריש גיטין דמיירי בגט אומר הש"ס עדים וכו' ורבנן הוא דאצרכו קיום ע"ש דגט הוא מן התורה אבל בכתובות י"ח: אינו אומר הש"ס לשון זה משום דמיירי בשטר ראיה ועיקרו מדרבנן כדעת הירושלמי]: