This end turn checking is original SSI code, so it's a bit impenetrable to understand for someone who is not the original programmer.
But it is written to allow for a few extra turns before it quits - i.e. random ending. Since this game is quite near the end, then that bit may have kicked in on you.
Also, since its a teensy-weensy little map with a shotgun pattern of V-hexes then the SSI code just may well be measuring one of the off map (-1,-1) units as being within 10 (or whatever the magic number is) hexes away from one of these splattered V-hexes. I'll know more, once I test it a bit later this year.
Thanks for the game - I'll be using it as an edge test example to try to figure out what the original code is trying to do. It may be a simple fix, or I may simply recode it with something that makes sense to me

...