しまっていた

had already

→ 仕舞う
phrase Rare #22,235
had already Attached to a verb’s て-form, it indicates that an action was already completed by a past point in time. It can also suggest regret or an unwanted outcome.
JA: 私が着いた時には、みんな帰ってしまっていた。
EN: By the time I arrived, everyone had already left.

彼が帰宅したときには、太陽はもう沈んでしまっていた。

By the time he got home, the sun had already set.

がっかりしたことには、彼はすでに出発してしまっていた。

To my disappointment, he had already left.

子供たちは私が家に帰るまでにクッキーを全部食べてしまっていた。

The children had eaten all the cookies by the time I got home.

私が学校に着いた時には、その競技は終わってしまっていた。

By the time I arrived at school, the competition was already over.

全部なくなってしまっていた。

It had all disappeared.

私が成田空港に着いたとき彼の飛行機はすでに出発してしまっていた。

When I arrived at Narita Airport, his plane had already departed.

駅に着いたら列車はもうすでに出てしまっていた。

When I arrived at the station, the train had already left.

彼は私が訪問した時には宿題を終えてしまっていた。

He had already finished his homework by the time I visited him.

私は財布をなくしてしまっていた、それでそのカセットが買えなかった。

I had lost my wallet, so I couldn't buy that cassette.