pīḍayā kriyate tapaḥ
tat tāmasam udāhṛtam
There are instances of foolish penance undertaken by demons like Hiraṇyakaśipu, who performed austere penances to become immortal and kill the demigods. He prayed to Brahmā 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.