That is just how enemies work. They bounce off the walls to keep from clipping into them.
I'm planning on making a better "pathfinding" (there is no real pathfinding, enemies are just being lucky).
Ok that's cool. Maybe for now I'll just use enemies that stand still in the hallways with their gun - like guards. In larger areas the movement works fine.