Fetching details from the dictionary...
to miss one's footing
to be off the right track; to be on the wrong path
何か悪いことを企んでいる。
He is scheming something bad.
彼らは密かに脱走を企んだ。
They secretly plotted an escape.
危険なことを企んだら必ず失敗するよ。
If you plot something dangerous, you'll surely fail.