Some lucky places can open ports for the giant ships to stop and refuel/resupply, that brings a lot of income.
Though maybe I've got the scale wrong, and these ships can just buy more fuel and more food at their departure ports and go around Africa without stopping...
They just go around. It’s not catastrophic just adds cost and time. No refueling or ports required for these mega carriers. We’d go around the cape sometimes just because of loads, some aren’t allowed through, or because fees were too high for the value of cargo. Depending on the size of the carrier it can add 20 days or so to the voyage.