|Chapter 17, Verse 19|

मूढग्राहेणात्मनो यत्पीडया क्रियते तपः।परस्योत्सादनार्थं वा तत्तामसमुदाहृतम्।।17.19।।

ॐ

Transliteration / Meaning

mūḍha-grāheṇātmano yat pīḍayā kriyate tapaḥ
parasyotsādanārthaṁ vā tat tāmasam udāhṛitam

Translation

Penance performed out of foolishness, with self-torture or to destroy or injure others, is said to be in the mode of ignorance.

Purport by Srila Prabhupada

There are instances of foolish penance undertaken by demons like Hiranyakasipu, who performed austere penances to become immortal and kill the demigods. He prayed to Brahma for such things, but ultimately he was killed by the Supreme Personality of Godhead. To undergo penances for something which is impossible is certainly in the mode of ignorance.