Torah Temimah cites Nedarim 16b.
One might think that if he swore to nullify a mitzvah and did not, he would be liable — Scripture says “to harm or to benefit”: just as benefit is optional, so harm is optional.
Oaths to violate a mitzvah are excluded from the oleh ve-yored of shevu’as bitui by the parallel of optional benefit.
Category E — Analogy / comparison
Method — The Gemara compares optional benefit with optional harm: since benefit in this verse must be an act the person is free to do, harm must likewise be optional. An oath to violate a mitzvah, which the person has no authority to violate, is excluded from this korban liability.
Textual trigger — “לְהָרַע אוֹ לְהֵיטִיב,” interpreted as “מַה הֲטָבָה רְשׁוּת אַף הֲרָעָה רְשׁוּת.”