Bhagavad Gita 17.13
Sacrifice that is contrary to scriptural command, that is unaccompanied by prayers or gifts of food or money, and is without faith—that is the product of ignorance.
विधिहीनमसृष्टान्नं मन्त्रहीनमदक्षिणम्।श्रद्धाविरहितं यज्ञं तामसं परिचक्षते॥vidhihīnamasṛṣṭānnaṃ mantrahīnamadakṣiṇam|śraddhāvirahitaṃ yajñaṃ tāmasaṃ paricakṣate||
English translation (above): Shri Purohit Swami (1935), public domain. Sanskrit text via github.com/gita/gita (Unlicense).