To be honest, I think the answer is in your question: find a real problem to solve. I know that sounds like a simplistic answer, but I think the best advice is usually the obvious answer
Is is that the company thought it was solving something that turned out not to be a problem (or a compelling-enough problem worth solving), or that it was building a solution without knowing or caring to know what problem it solved?
If the current situation itself is already generating profit for the company, I recommend that you refrain from getting involved in it and instead carefully convey an alternative solution to upper management
some of the learnings are not applicable anymore, but i benefited a lot from the framework we created