There are several categories in which extrajudicial punishment is considered.
- One category is the rodef; pursuer. The Talmud assumes in many places that anyone may and indeed must kill a rodef if that is necessary to save his intended victims. (E.g. Sanhedrin 22b). This is in turn codified by Rambam (Hilkhot Roteah 1:6 who counts this as a special mitsvah).
- Another category is that of kanaim pog'in bo; (the zealots engage him). mentioned in the Mishnah (Sanhedrin 9:6). This category comprises three subcategories: a) the thief of a consecrated vessel in the Temple. b) one who curses God with the name of an idol (cf. Rambm's commentary there). c) One who has sexual relations with certain (cf. Hilkhot Issurei Biah 12:5) non-Jewish women in the presence of ten Jews (cf. Hilkhot Issurei Biah (12:4).
- A similar law applies to a kohen who performs his duties in the Temple while ritually impure.
Unlike a rodef, however, the cases of kanaim pog'in are not officially sanctioned (their exact status is debated). If one asks the courts if he should engage in such zealotry, they tell him not to (Sanhedrin 82a, Hilkhot Issurei Biah 12:5). Indeed, in some cases discussed here at length, the subject of kanain pog'in can actually kill the zealot, and be exempt. Furthermore, some sources imply that the zealot is never supposed to harm anyone, but rather is exempt from doing so in certain cases.
- The next category, (and that most relevant to your examples) is that of moridin aval lo ma'alin; people who are killed, and not rescued (Avodah Zara 26b). These include Jews who betray other Jews to the gentile authorities (Hilkhot Hovel UMazik 8:10), And (most significantly) it applies to heretics (Hilkhot Rotseah 4:14, Hilkhot Avodah Zara 10:2) and certain wanton sinners (ibid). The stated reason (ibid) for the betrayer, the heretic, and the wanton sinner is that they actively threaten and harass other Jews (apparently both physically and spiritually).
As with most of the other categories of extrajudicial punishment, there are numerous restrictive factors, too numerous to list here, that render this nearly (if not wholly) inapplicable.
Significantly, neither of the examples you gave seem to satisfy even the basic parameters delineated above for any of the aforementioned categories. The latter example, for example, is far from the heretic described (Hilkhot Roteah 4:10) as denying prophecy (and by extension Judaism). The former example does not seem similar to the definition of wanton sinner (cf. Hilkhot Yesodei HaTorah 5:13) as someone who sins. Furthermore, the examples in Hilkhot Avodah Zara (10:2) are to those who actively remove Jews from the entire Jewish belief system; not just from individual mitsvot. Even a Jew who frequently sins, is not only excluded from the category of those who are lowered (to their demise), but he is excluded from the category of those who are merely not actively saved. Rather, a Jew, even one who sins frequently, must be saved (Hilkhot Rotseah 4:17).
It ought to go without saying that all of the above is a purely academic survey of some related sources and categories relating to extrajudicial punishment. The reality, as usual is much more complex, and applicability of the above is quite limited, or wholly inapplicable. Only a reckless idiot would harm someone based on the claims of an anonymous internet character.