There is no Spoon - Episode 2 puzzle discussion

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.