功亏一篑 gōngkuīyīkuì to fall short at the last minute
to fail to complete a project due to the lack of a final effort; to fall short of success when one is just one step away from finishing. Originally referring to failing to complete a mountain for lack of one final basket of earth.