We know that Sins punishable by death are punished when there are witnesses and warning. We also know that when there are no witnesses, but the sin is made intentionally, the punishment is Caret (1). What is the source in Gemara for this last rule? I found in several Gemarot that there is Qorban Chatat only for sins that are punishable by Caret when intentionally made.
״וְכִי תִשְׁגּוּ וְלֹא תַעֲשׂוּ אֵת כׇּל הַמִּצְוֹת הָאֵלֶּה״, וּכְתִיב: ״וְהַנֶּפֶשׁ אֲשֶׁר תַּעֲשֶׂה בְּיָד רָמָה״. הוּקְשׁוּ כּוּלָּם לַעֲבוֹדָה זָרָה: מָה לְהַלָּן דָּבָר שֶׁחַיָּיבִים עַל זְדוֹנוֹ כָּרֵת וְשִׁגְגָתוֹ חַטָּאת, אַף כׇּל דָּבָר שֶׁחַיָּיבִין עַל זְדוֹנוֹ כָּרֵת וְעַל שִׁגְגָתוֹ חַטָּאת.
But I don't find the rule that a sin punishable by death penalty is punishable by Caret when there is no witnesses.
I know that the Gemara in the third chapter of Ketubot says that Chyuve Mita, the sentence is executed by events when there is no Bet Din. But this is an other issue.
I know that in Bamidbar 15, Megadef is Caret. But for Rabanan (Keretot 7b and Pesachim 93b) it's to sing for Avoda Zara, not punished by death penalty, and for Rabbi I assume that is to curse Hashem without the name of Hashem, following Sanhedrin 56a.
(1): See Sefer Hamitzvot from the Rambam Lo Taase 352.
וכן התבאר לך שכל מי שנתחייב מיתה בבית דין איזו מיתה שתהיה הנה האיש ההוא בכרת גם כן כשלא המיתוהו בית דין או לא נודע לו, מלבד עשרה אנשים שהם מחוייבי מיתת בית דין ואין עליהן כרת והם מסית ומדיח ונביא שקר ומתנבא בשם ע''ז וזקן ממרא ובן סורר ומורה וגונב נפש מישראל ורוצח ומכה אביו ואמו ומקלל אביו ואמו, וכל אחד מאלו כשנחקרה עליו העדות יהרג, ואם לא יהרג שלא יוכלו בית דין להרגו או לא נודע לו הנה הוא מתיר עצמו למיתה אבל אינו עומד בכרת. ושמור אלו השרשים וזכור אותם
Translation (From Sefaria).
And likewise has it been made clear to you that anyone who is liable for a death penalty of the court - whatever death penalty it may be - behold, that man is also [punished] with excision, when the court did not kill him or it it did not know about it - except for ten cases... etc... And hold on to these principles and remember them.
Megadef is not included in the list of exceptions.