Good tidings and warning normally point in different directions: one raises hope, the other signals danger. By placing the vocabulary of good tidings in a threatening context, the Qur’anic expression heightens the force of warning.
Surface expression: announcing welcome news.
Intended effect: threatening with punishment and awakening moral concern.
Contextual indication: “painful punishment.”
A genuinely happy announcement using the same verb would not be an ironical metaphor. Classification depends on the contextual intention, not on a particular word isolated from its sentence.