Chapter 16 · Divine and Demonic Natures · Krishna said
Bhagavad Gita 16.23 — Acting on whim
यः शास्त्रविधिमुत्सृज्य वर्तते कामकारतः। न स सिद्धिमवाप्नोति न सुखं न परां गतिम् ॥
yaḥ śāstravidhimutsṛjya vartate kāmakārataḥ | na sa siddhimavāpnoti na sukhaṃ na parāṃ gatim ||
Meaning
One who sets aside the guidance of scripture and acts on whim gains neither perfection, nor happiness, nor the highest goal.