As per Unity documentation on Navigation Areas and Costs it states that:
Another thing you may notice on some
levels is that the pathfinder does not
always choose the very shortest path.
The reason for this is the node
placement. The effect can be
noticeable in scenarios where big open
areas are next to tiny obstacles,
which results navigation mesh with
very big and small polygons. In such
cases the nodes on the big polygons
may get placed anywhere in the big
polygon and from the pathfinder’s
point of view it looks like a detour.