I just debugged mine thanks to @karelpeeters when there are multiple targets at the same distance you should pick the path to the target closest in reading order, not the path that starts with a move closest in reading order. Thats just a bit different, and for none of the tests this difference is relevant.