What is the idiom or proverb or phrase for this "hard packing but loose knot"?
For example, you took hard preparation for the exam, but, didn't attend it.
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It only takes a minute to sign up.Sign up to join this community
You could say that it was all for naught:
without achievement or result
I spent a long time preparing for my test, but it was all for naught.
[The Free Dictionary]
Not exactly what you're asking, but you could say that all of your hard work was in vain.