Thank you for the feedback.
I tried to solve this puzzle and came up facing the exact same issues.
I was so upset that I fixed the stuff myself.
-
The heuristics to use is now given in the statement. Hopefully, the octile distance was the intended one… at least, this is the one I use to achieve 100%.
-
givenCost is now computed correctly, with a max as you mentioned.
-
I have added the closed list, so that a node is never revisited.
-
When providing an invalid node, the referee will give a correct node in the error message.
-
Unfortunately, this final point can’t be fixed easily. What we should do is providing some input each turn. But there is nothing significant to provide.

EDIT: @R2B2: Let me know if you still encounter some issues.