To button (a garment) incorrectly — i.e., to fasten buttons in the wrong order or misalign them so the garment is improperly fastened.
家を出てから気づいた。セーターのボタンを掛け違えていた。
I noticed after leaving the house that I'd buttoned my sweater wrong.
小さい子はよくボタンを掛け違えて服を着ていることがある。
Small children often put their clothes on with buttons misaligned.
鏡で確認したら、シャツのボタンを掛け違えているのに気づいた。
When I checked in the mirror, I realized my shirt's buttons were misdone.
Idiomatic: to bungle the order of things or to act/speak inappropriately; used figuratively for getting things out of order or making a misstep.
彼は会議の進行でボタンを掛け違えてしまい、資料の順番がめちゃくちゃになった。
He bungled the meeting procedure and messed up the order of the documents.
言葉選びを間違えて、面接でボタンを掛け違えてしまったと感じた。
I felt I had put my foot in it during the interview by choosing the wrong words.
プロジェクトの段取りをボタンを掛け違えると、後で取り返しがつかない。
If you get the project's sequencing wrong, it can be irretrievable later.