It's worth reflecting on the fact that for most of human history, sea travel is easier and faster than land travel. That's one of the main reasons why major towns and cities are centered on river access.
It's easier to sail to and from Madagascar to much of Asia than it is to sail to Madagascar across the Madagascar channel.
[0] - https://commons.wikimedia.org/wiki/File:Corrientes-oceanicas...
At the time there was no Suez canal. Going from europe to China by sea would mean go around Africa which was a challenge by itself.
Although there was a Suez canal at various times in antiquity, albeit one between the Red Sea and the Nile, not the Mediterranean directly.