宝の山に入りながら手を空しくして帰る(たからのやまにいりながらてをむなしくしてかえる)

Japanese vocabulary

Meaning: to have a good opportunity only to let it slip from your grasp; to come home empty-handed despite having entered treasure mountain

See it used in real works