If you have valuable goods/services you can offset the transport costs and exchange them for food or whatever you need.
The same rules apply at the individual level. How many engineers are self sufficient? How many cities are self sufficient? Is it really worth it to build all kind of redudant systems (i.e people building bunkers for their families and learning survival skills) ? I think we already know the answer.
On the other hand countries that must import food, suffer greatly when there’s any economic shock. Basic food stocks can double or tripe in price due to inflation affecting imports most strongly. And the country is trapped: it must export in order to get money to buy food, however demand is already down. Add to that that many counties run on credit, so failing an import/export balance leads to additional debt, increased inflation, and a vicious spiral to economic ruin.
Even if there were a network of planets. They'd need to be self sufficient in key areas (food, air, water, shelter) as the time and energy needed to trade is likely too much for robust exchanges.