You'll see this in any automap where the rooms aren't linear. If, for instance, you go east from room 1 to room 2 and go west from room 2 to room 3, this is the kind of automap you'll see. The automap is judging all exits and this is what it finds.
It is not a bug, it's just the code trying to make sense out of exits that don't quite make sense. If you try to map in a grid, you'll find it doesn't work. I can't try it out right now because I don't have the right tools for it, sorry.