The decision to enter a PhD program only makes sense for one of the two reasons: either you think you're going to win a Nobel Prize one day, or, you don't mind spending five years in a way which doesn't advance any goal (literal quote from a conversation I had, "so you had an offer from Google but you decided to do a PhD instead--why??", "Oh, I just want to do nothing for a while longer".)
The two kinds of PhD students may look the same but they're very different. If you belong to the first category, even if you realize you won't get that Nobel Prize, I doubt you're going to regret trying. If you're of the second kind, why yes, you have wasted five years of your life, which is exactly what you signed up for so why do you complain?