Language:
Free Online Dictionary|3Dict

事败垂成

Source : CEDICT

to fail on the verge of success (idiom)