A court is liable only for a hidden matter together with an inadvertent act. As the sages taught: "they err" (compare Numbers 15:24); one might think they are liable for an inadvertent act alone, therefore Scripture says "they err and a matter is hidden": they are liable only for a hidden matter together with an inadvertent act. And so the anointed priest, for it is written "to the guilt of the people," which makes the anointed priest like the community. And so in idolatry, as the sages taught, since idolatry went out to be judged on its own. As for the anointed priest in idolatry, Rabbi says: by an inadvertent act, while the sages say: by a hidden matter together with an inadvertent act; and they agree that with a she-goat he is like the individual, and they agree that he does not bring a suspended guilt offering. What is Rabbi's reason? It is written "and the priest shall atone for the soul that erred" (Numbers 15:28): "the soul," this is the anointed priest; "that erred," this is the prince. "In sinning in error," Rabbi holds "sin" here means an inadvertent act, while the sages hold this means one whose sin offering comes for inadvertence, excluding the anointed priest whose offering comes not for inadvertence but for a hidden matter. And whence that with a she-goat he is like the individual? Scripture says "if one soul" (Numbers 15:27): each of them, individual, prince, and anointed priest, is included in "one soul." And whence that he brings no suspended guilt offering? This is Rabbi's reason: if so, let Scripture write "for his error"; why "that he erred"? This teaches there is liability only when his whole sin is in error.
When a Court Errs in Ruling and the People Act
Yalkut Shimoni on Torah 467:1
אֵין בֵּית דִּין חַיָּבִין אֶלָּא עַל הֶעְלֵם דָּבָר עִם שִׁגְגַת מַעֲשֶׂה דְּתָנוּ רַבָּנָן "יִשְׁגּוּ", יָכוֹל יְהוּ חַיָּבִין עַל שִׁגְגַת מַעֲשֶׂה, תַּלְמוּד לוֹמַר (שם) "יִשְׁגּוּ וְנֶעְלַם דָּבָר", אֵין חַיָּבִין אֶלָּא עַל הֶעְלֵם דָּבָר עִם שִׁגְגַת מַעֲשֶׂה. וְכֵן הַמָּשִׁיחַ דִּכְתִיב "לְאַשְׁמַת הָעָם", הֲרֵי מָשִׁיחַ כְּצִבּוּר. וְכֵן בַּעֲבוֹדָה זָרָה, דְּתָנוּ רַבָּנָן, לְפִי שֶׁיָּצְתָה עֲבוֹדָה זָרָה וְכוּ'. מָשִׁיחַ בַּעֲבוֹדָה זָרָה, רַבִּי אוֹמֵר בְּשִׁגְגַת מַעֲשֶׂה, וַחֲכָמִים אוֹמְרִים, בְּהֶעְלֵם דָּבָר עִם שִׁגְגַת מַעֲשֶׂה. וְשָׁוִין שֶׁבִּשְׂעִירָה כְּיָחִיד. וְשָׁוִין שֶׁאֵין מֵבִיא אָשָׁם תָּלוּי. מַאי טַעְמָא דְּרַבִּי, דִּכְתִיב "וְכִפֶּר הַכֹּהֵן עַל הַנֶּפֶשׁ הַשֹּׁגֶגֶת", "הַנֶּפֶשׁ" זֶה מָשִׁיחַ, "הַשֹּׁגֶגֶת" זֶה נָשִׂיא. "בְּחֶטְאָהּ בִּשְׁגָגָה", רַבִּי סָבַר "חֵטְא" זֶה בְּשִׁגְגַת מַעֲשֶׂה. וְרַבָּנָן סָבְרֵי זֶה מִי שֶׁחַטָּאתוֹ בִּשְׁגָגָה, יָצָא מָשִׁיחַ שֶׁאֵין חַטָּאתוֹ בִּשְׁגָגָה אֶלָּא בְּהֶעְלֵם דָּבָר. וְשָׁוִין שֶׁבִּשְׂעִירָה כְּיָחִיד מְנָלַן, אָמַר קְרָא (שם טו, כז) "אִם נֶפֶשׁ אַחַת" אֶחָד יָחִיד וְאֶחָד נָשִׂיא וְאֶחָד מָשִׁיחַ כֻּלָּן בִּכְלַל "נֶפֶשׁ אַחַת" הֵם. וְשָׁוִין שֶׁאֵין מֵבִיא אָשָׁם תָּלוּי, הַיְנוּ טַעְמָא דְּרַבִּי דְּאִם כֵּן לִכְתֹּב קְרָא "עַל שִׁגְגָתוֹ", לָמָּה לִי "אֲשֶׁר שָׁגָג", הָא קָא מַשְׁמַע לָן עַד דְּאִיכָּא כָּל חַטָּאתוֹ בִּשְׁגָגָה. וְרַבָּנָן מִי שֶׁחֶטְאוֹ בִּשְׁגָגָה, יָצָא מָשִׁיחַ שֶׁאֵין כָּל חֶטְאוֹ בִּשְׁגָגָה אֶלָּא בְּהֶעְלֵם דָּבָר.