To kind of go against the flow here: _most_ of the projects I worked on seemed to be a waste of time when I worked on them, but ended up making a lot of money many years later, years after I'd moved on. I like the green field stuff, and green field stuff looks like a waste of time most of the time. The first three versions suck ass and don't do much, but without having them you don't get to something that doesn't suck. Both the first and the second project I worked on at MS seemed like horrible waste of time in early aughts, but have likely made tens of billions of dollars for it by now.
Then there are projects where I did something ahead of its time (and was ultimately unsuccessful) yet other people did the exact same thing later and made a ton of money.
Finally I ran engineering at a startup which spent ~3 years largely wasting time and money, only to be acquired for hundreds of millions of dollars for reasons that are still unclear to me.
You never really know. Success is a random, nonlinear process and your effort is but one input to it. I've given up trying to predict if something will be successful if the work that's being done at the front lines is solid from the engineering standpoint. Business is mostly about being very persistent and/or being in the right place at the right time.
For all you know your company might be one PhD hire away from absolutely blowing the doors off competition. Or it may get to that point years later because it started thinking about it now. Or having at least some sort of an AI strategy (even if not very successful) might double the acquisition price in some upcoming merger. All of those things would make your work worthwhile in retrospect even if the project fails. You never know such things.
These uncertain situations are usually a blessing in disguise: because management has no clue, you can pretend that you have clue, and steer things in the direction that's useful to you. Put some cool things on your resume, if nothing else. Move on, see if you have better luck elsewhere.