Only to find that / I thought... but actually
Indicates a surprising or unexpected result that differs from one's assumption, used in both written and spoken contexts.
Examples
彼が成功すると思いきや、実は苦労していた。
I thought he would succeed, but in fact, he was struggling.
この問題は簡単だと思いきや、実は非常に複雑だった。
I thought this problem was simple, but it was actually very complex.
彼女が参加すると思いきや、都合が悪くて来れなかった。
I thought she would attend, but she couldn't make it due to circumstances.
Quick check
この問題は簡単だ___、実は非常に複雑だった。