As such, it can simply stay stuck at a local minima if there is no selection pressure.
More to the point in this case, they can get stuck in a local maximum which is not a global (or even regional) maximum, with no path of continually improving results that will lead away from the local maximum. At which point, natural selection won't be able to drive the system away from the non-optimal solution.
A system might be able to evolve away from such a situation, but it probably relies on "lucky leaps" of evolution, such as gene duplications.
Natural selection is undoubtedly powerful, but is not a panacea.