Pathfinding doesn't always work correctly, here are some screenshots from the improvement tutorial:
This is fine:
This is bugged, it should take 2 turns to get here, instead of being unreachable:
This is fine:
This is bugged, it should take 4 turns to get there, with a couple different paths available, instead it takes the 26 turn route that is available without embarking/debarking:
This is fine:

This is bugged, it should take 2 turns to get here, instead of being unreachable:

This is fine:

This is bugged, it should take 4 turns to get there, with a couple different paths available, instead it takes the 26 turn route that is available without embarking/debarking:
