fall at the last hurdle

/ˈfɔːl æt ðə ˌlɑːst ˈhɜːdl̩/verb
Graduate
1

To fail near the end of an activity, a project, etc.