Because it is written in Ladino originally, it it difficult to determine what Rabbi Yaakov Culi zl meant. The Torah Anthology, Me'am Loez you are citing doesn't say the gematria of brit milah (circumcision) is 1022, it is ברית קדוש, brit kodosh, that has the gematria of 1022, which means "Holy Covenant."
Chazal in Shabbat 156b discuss the fact that mazal does not apply to Jews, and makes no mention of sexual misdeeds specifically disqualifying someone. Rabbi Yochanan derives the idea that Jews do not fall under mazal from Jeremiah 10:2:
Rabbi Yoḥanan said: From where is it derived that there is no constellation for the Jewish people? As it is stated:
כֹּ֣ה ׀ אָמַ֣ר יְהֹוָ֗ה אֶל־דֶּ֤רֶךְ הַגּוֹיִם֙ אַל־תִּלְמָ֔דוּ וּמֵאֹת֥וֹת הַשָּׁמַ֖יִם אַל־תֵּחָ֑תּוּ כִּי־יֵחַ֥תּוּ הַגּוֹיִ֖ם מֵהֵֽמָּה׃
Thus said the Lord: Learn not the way of the nations, and be not dismayed at the signs of heaven; for the nations are dismayed at them” (Jeremiah 10:2)
The nations will be dismayed by them, but not the Jewish people.
The Malbim zl comments on Jeremiah here:
"If you do not learn to walk in the way of the nations, then you will not be susceptible to the stars, for you are under the supervision of the Lord, not under the rule of the celestial arrangement. Only when you learn the way of the nations will you go out of direct supervision. Also, do not think that idols are useful for producing a desirable fortune from the stars."
From these sources, it would seem this concept applies to anyone who is considered a Jew, and not engaging in the practices of the nations. All this to say that what the Torah Anthology Me'am Loez refers to (sexual misdeeds specifically causing a person to be subject to mazal) cannot be ascertained from other sources, as far as I can see. Instead we will have to reflect upon how Rabbi Yaakov Culi zl treats the subject matter elsewhere.
Later in Sefer Bereshit parashah VaYeshev, Rabbi Culi zl gives an explanation of how to do teshuvah for illicit emission of semen (Gen 38.9), and the translator, Rabbi Aryeh Kaplan zl, cites Rabbi Nachman of Breslov zl to demonstrate another tikkun, which he says is considered a "complete rectification for masturbation and nocturnal emissions."
(Torah Anthology, Me'am Loez Series, 3a, p. 283, footnotes)
Now we know that:
Rabbi Culi zl himself gives a tikkun for this sin
Rabbi Aryeh Kaplan zl, who is one of the foremost experts on the
Yalkut Me'am Loez, offers what he designates as a complete tikkun for this sin
A Jew's exemption from mazal is not mentioned as being effected more by sexual sins than
any other sins, according to any other source (as
far as I am aware).
It seems to me that if someone does proper teshuvah for this sin then they would be back in the position of someone who had never committed such a sin, as the Rambam ztl in MT Repentance 7.4 says "A Baal-Teshuvah should not consider himself distant from the level of the righteous because of the sins and transgressions that he committed. This is not true. He is beloved and desirable before the Creator as if he never sinned."
Therefore the Torah Anthology, Me'am Loez Series, is referring here to someone who is engaging in sexual misdeeds or has done so without ever doing teshuva for these sins.