In the following sentence I have to write one word:
One annoying example of this is when you walk into a room, _____ to realise you have forgotten what your reason for going there was.
According to the key, it is only. But why doesn't just work? No dictionaries have evidence for this phrase. The only reliable source was ludwig.guru, which suggests both work. Would you accept my answer?