It was because my array of directions was in the wrong order.
It should be E, SE, S, SW, W, NW, N, NE . In an attempt to organize my script, I rearranged them, and that must have been when the bug came to be.
If I were gazing at a visual equivalent of my code (in this case, a pizza divided into 8 slices), I would have seen that the indexes created by the wrapi method are specific directions or angles that must match the order of the array, as it scans clockwise 360 degrees.
Thank you @DaveTheCoder, @axolotl, @kuligs2 for taking the time to help me. 🙂
At least now I've learn more about how this function works, and I know about GUT and how helpful it can potentially be when I grasp it fully.
I look forward to coding more, now that I'm not being tormented by this bug.