PathfindingService will sometimes generate paths which begin or end on the opposite side of a wall relative to the given origin and target points. This problem is particularly noticeable when navigating near staircases and slopes adjacent to walls.
I think the pathfinding path computation just finds the points on the nav mesh closest to the input origin and target points, which just so happen to be on the other side of the wall.
Sorry I just edited my response to be clear . While i was typing i saw you responded as well . If you see the image you shared , you can see the stairs are not colored blue completely which points to issue with navmesh generated .
Yes, this is not an intentional behaviour. Unfortunately we currently dont have any settings you can fiddle with to improve the navmesh accuracy. The only way is to move the parts which you are already figured out.
We will investigate this issue though to see what is going on.