But why is it failing on an intermediate-leveled CG and not the very hard last one??
Perhaps with your approach, your code happens to hit a less efficient search order on the intermediate case, like itβs exploring a denser part of the search space earlier on. The harder case might just be lucking out with a more favourable search path. Try adding some code to count the number of iterations (or things like that) and compare.