We are told: וְכִי תִשְׁגּוּ וְלֹא תַעֲשׂוּ אֵת כָּל הַמִּצְוֹת הָאֵלֶּה, “And when you err and not observe all these commandments…”. (Num. 15,22) The Torah prescribes a specific sacrifice that had to be brought for atonement. Chazal realized that the intention could not be referring to one who transgressed all the commandments. Hence they explain that it refers to one who transgressed a specific law that in effect denies the entire Torah, which means idolatry.
After the sacrifice will have been brought the Torah says: וְנִסְלַח לְכָל עֲדַת בְּנֵי יִשְׂרָאֵל וְלַגֵּר הַגָּר בְּתוֹכָם, “And all the congregation of the Children of Israel shall be forgiven, and the stranger (Ger) that sojourns among them…”. (Num. 15,26) Rabbi Soloveitchik asks why the stranger is singled out. His answer is that when the Jews journeyed in the Wilderness the strangers that came along from Egypt were the ones who caused all the conflicts and disturbances. Hence we are told that after atonement they too would be forgiven.
He further points out that at Kol Nidre night we recite this very same verse. The reason is that at the beginning of the service a statement is made that we sanction prayer with the transgressors. The atonement effected by the very day of Yom Kippur is compromised if any members of the Jewish people are excluded. We thus quote a statement from the Torah that even the strangers or proselytes are forgiven.