甲斐がない/甲斐(も)なく => it's not worth one's efforts to do something N2
甲斐がある => It’s worth one’s efforts to do something N2
~ひょうしに(~拍子に)   => the moment [A], unintentionally / inadvertently caused something to happen N1