It was stated: one who supposed it was an animal and it turned out to be a person, or supposed it was a gentile and it turned out to be a resident alien. Rava said: he is liable. Rav Chisda said: he is exempt. Rava said he is liable, because one who says "it is permitted" is close to acting deliberately. Rav Chisda said he is exempt, because one who says "it is permitted" acts under compulsion. Rava raised an objection to Rav Chisda: "You are a dead man because of the woman you have taken" (Genesis 20:3). Does this not mean by human hands? No, by the hands of Heaven, for it is written, "from sinning against Me" (Genesis 20:6). Rav Chisda replied: by your own reasoning, "and I would have sinned against God" (Genesis 20:6) means against God and not against a human being. Rather, his judgment was handed over to a human; here too his judgment was handed over to a human. Rava further objected from "Will You slay even a righteous nation?" (Genesis 20:4). There the answer was as they responded to him, and so on.
When Acting in Error Still Carries Guilt Before Heaven
Yalkut Shimoni on Torah 88:2
אִיתְּמַר כַּסָּבוּר בְּהֵמָה וְנִמְצָא אָדָם, גּוֹי וְנִמְצָא גֵּר תּוֹשָׁב, רָבָא אָמַר חַיָּב רַב חִסְדָּא אָמַר פָּטוּר, רָבָא אָמַר חַיָּב, אוֹמֵר מֻתָּר קָרוֹב לְמֵזִיד הוּא, רַב חִסְדָּא אָמַר פָּטוּר, אוֹמֵר מוּתָר אָנוּס הוּא. אֵיתִיבֵיה רָבָא לְרַב חִסְדָּא, הִנְּךָ מֵת עַל הָאִשָּׁה אֲשֶׁר לָקַחְתָּ מַאי לָאו בִּידֵי אָדָם, לֹא בִּידֵי שָׁמַיִם, דִּכְתִיב, (להלן פסוק ו) מֵחֲטוֹ לִי. וּלְטַעֲמֵיךְ "וְחָטָאתִי לֵאֱלֹהִים", לֵאלֹהִים וְלֹא לָאָדָם אֶלָּא דִּינוֹ מָסוּר לָאָדָם הָכָא נַמֵי דִּינוֹ מָסוּר לָאָדָם. אֵיתִיבֵיה (להלן פסוק ד) הַגּוֹי גַּם צַּדִּיק תַּהֲרֹג הָתָם כְּדְקָא מְהַדְרֵי עָלֵיה וְכוּ'.