Your bad experience is because AI can’t really reason in general. It gets some kinda reasoning via a transformer, but that’s nothing like the reasoning that goes into the problem you described.
LLMs are great at translation. Turn this English into code, essentially. But ask it to solve a novel problem like that without a description of the solution, how will it approach it? If there’s an example in its training set maybe it can recall it. Otherwise it has no capability to derive a solution.
However, most problems (novel problems, problems not in the training set) can be decomposed into simpler, known problems. At the moment the AI isn't great at driving this decomposition, so that has to be driven by a meat bag.
LLMs are great at translation. Turn this English into code, essentially. But ask it to solve a novel problem like that without a description of the solution, how will it approach it? If there’s an example in its training set maybe it can recall it. Otherwise it has no capability to derive a solution.