、。
It was through a strange twist that I found out the truth — right when I was about to give up on the whole thing.
Literal
Strange thing [from-から] true thing [subject-が] understood [explanatory-んだ], almost hand [object-を] withdraw-about-to-かけた time [at-に].
A narrative reveal sentence. ひょんな is an archaic/old-fashioned adjective meaning 'strange,' 'unexpected,' 'odd' — survives today mainly in the fixed expression ひょんなことから ('from some strange/unexpected circumstance'), which introduces unplanned discoveries or chance meetings. 手を引く ('to pull one's hand out') is an idiom meaning 'to withdraw from,' 'to give up on,' 'to back out' — originally a gesture of physically letting go. The auxiliary ~かける attached to a verb stem means 'be on the verge of,' 'about to do' — 手を引きかける = 'on the verge of giving up,' 'almost withdrawing.' The whole second clause is fronted after the main reveal, a narrative trick that delays the time frame until after the punchline.