[sentence]、却って + [sentence]
却って says that something had the opposite effect to the one you expected: the medicine made you feel worse, the shortcut took longer. It is an adverb and goes in the second half of the sentence, just before the unexpected result. It is usually written in kana, かえって.
The first half sets up the expectation, often with きごう〜のに, きごう〜ようとしたら or きごう〜ために. Most of the time the result is worse than intended.
The reversal can also go the good way: something that looked like a setback turned out better.