I discovered a strange situation where guards choose a longer path to get to me.

I have a building with a large green garage door and a side door further away from the garage door. If the guard sees me while the garage door is open he will run in with no problem. If I first open the side door and then open the garage door, the guard will run the farther path to the area beyond the side door and then into the side door to get to my location.

I was always under the impression that AI chose the shortest possible path.