Changing the number in str_clip to 4 (or 5 for that matter) didn't allow me to use Treg_ and Tpath_, but it's cool because I can still use custom names. reg_tee and path_tee work perfectly without any need to edit your code at all. Curiously, the code block that contains "draw_text(str_for_num(NULL,i),temp.x-10,temp.y-10,COLOR_RED);"
doesn't seem to work with my custom names. I know it's merely for debugging purposes to let us see the nodes' locations during run time, but I thought it might be worth pointing out.

How do I disable hpf_path_get_target_collision? Would changing
Code:
var hpf_path_get_target_collision = 1;

in line 63 to
Code:
var hpf_path_get_target_collision = 0;

do the trick?

The values I got after replacing the error code with the printf you suggested were
"Start: -1, Target: 1, Max_nodes: 12" (got this a few times)
"Start: 7, Target: -1, Max_nodes: 10" (same path as above after I deleted 2 unnecessary nodes. They weren't connected to the rest of the nodes)
"Start: -1, Target: 1, Max_Nodes: 6"
"Start: 6, Target: -1, Max_nodes: 10"
I still haven't found a way of reproducing the error 100% of the time. Sometimes, I'll try about 8 times and the AI will make his way to the target perfectly each time. The only pattern I've been able to notice is that the error pops up ONLY when the AI (and hence, the start node) is in a different region from the target/the player's position when I press "t" to trigger the function.
The error usually doesn't pop up as soon as I hit "t", but when the NPC has already traveled about halfway to his target, sometimes when he's just about to reach the target. Sometimes, the game still hangs without any error message.