Question: If it is said to a man, “Do such-and-such,” and he replies, “Ḥarām (forbidden),” what is the ruling of that?
Answer – and Allah is the One who grants success: According to the madhhab, that is not an oath; therefore, no expiation is required of him if he breaks it, nor is it even a figurative expression (kināyah) of an oath, for there is no kināyah in (the word) ḥarām. Thus it is stated in the marginal notes on Sharḥ al-Azhār according to the madhhab.
And one may argue for this by saying that the word “ḥarām” is a single, unconnected word, not predicated of anything upon which it falls; therefore, none of the rulings of an oath are attached to it. This is like when someone says, “By Allah,” or “I swear by Allah,” without adding anything to it that the oath falls upon; in such a case, it is of no legal consequence.
Source: Min Thimār al-ʿIlm wa al-Ḥikmah vol.2