Personally I loved every day of doing a PhD (admittedly I did it in Europe, not the US) and I feel like it's allowed me to work on much more interesting stuff afterwards as well.
I think the incentives in academia tend to lead to overproduction of PhDs in the long-term, as professors are incentivized to produce PhDs but there is no comparable incentive to help PhDs get jobs. Don't be fooled by "I'll write a recommendation letter for you" as that's probably not going to help you get a job. And I do know that NSF requires grant proposals to have a professional development plan, but the plans I've seen tend to be vague and frequently describe things that won't happen.
Keep in mind that you don't need to be in academia to do research. Instead of getting a PhD, I think it would have been better for me to get a real job with real pay for a while, doing research on the side. At some point I'd feel comfortable to switch to a part-time job or stop working for a while so that I could dedicate more time to research. When I was a PhD student, only rarely was I able to give my full attention to my research. I've had a variety of funding: fellowship, grant, teaching assistant, and even self-paid. The only time I was able to focus on my research was when I paid my tuition myself. (When I was on a fellowship, I had classes to distract me.) Grant projects can be hit or miss: If you like the project, it can be good, but if you don't like the project, then it's just a poorly paid job. Teaching assistant positions can require a lot more hours than are implied, unfortunately, and some professors are jerks. If my attention is going to be divided, at least I could get paid decently for it. I do think that by doing research on the side, I would have spent less time on my research, but it still would have been a lot of time over the years.
How much time someone in academia can devote to research depends a lot on their position. Your average professor seems to only dedicate around one day per week to research in my experience (certainly far less than 1/2 to 3/4 of the time), and mostly acts as a manager and a grant writer. (Some people seem to consider grant writing to be research time, but that doesn't make sense to me.) That's on top of the fact that professors tend to work a lot more than 40 hours per week. Around 60 hours per week seems about right in my experience.
There are more research-oriented roles (like postdocs) after getting a PhD, but they tend to be rarer. And I think this is true in academia broadly: I recall when speaking to Scott Aaronson before that he said since finishing his last postdoc, he's never done anywhere near as much research as a fraction of his time. (He did also say that being a parent takes more time than the non-research duties of a professor.)
In my experience, industry (and government) tends to have less hours of work per week. There certainly are research-focused jobs in industry and government (for example, scientists at NASA). But I've heard that in many industry positions, what you said is accurate: Any research one does is after the full-time work is done. To be honest, that might leave you more research time than a professor gets.
You'll develop all sorts of skills that will serve you well in industry should you decide academia isn't for you.
And the opportunity cost of not working in industry those few years will be a drop in the bucket in the long run.