If you look at countries that have successfully transitioned from 2nd/3rd world countries to 1st world economies, despite what "free market" boosters would have you think, nearly all of the started out with a huge amount of protectionism, so that domestic producers could improve their capacity without getting decimated by (initially) more advanced foreign competitors. South Korea is a great example of this, and of course China - while China is famous for its exports, China makes it notoriously difficult for foreign firms to compete in the country, often putting out the tantalizing notion of a huge market, but then stealing trade secrets and putting their thumb heavily on the scale in favor of domestic companies.
It will often be less beneficial for the fortunes of the "developed world" based institutions behind the philanthropy though, which is why the unconsidered default is often in the other direction (even without actual malicious intent which sometimes exists too), and it takes extra intention and commitment and willingness to sacrifice some self-interest.
Why do you think they don't have anything to invest?
How do you compete with something you didn't know existed until it showed up on your beaches and started stealing people?
Europe generated the capital to invest very, very slowly. The joy of foreign direct investment is in but having to spend centuries saving up.
[1] ACCOUNTING FOR THE GREAT DIVERGENCE Stephen Broadberry
It's easy when you're the first one in a non-globalized world where you literally create the capital by yourself, for yourself, and then spend it on yourself.
But trying to start an economy in Africa while competing with the pre-existing economy of the rest of the world... How is that the same thing?
So don't offer aid because it will stop capital investment. But there is no capital to invest because people spend their days trying to stay alive rather than obtaining capital.
So the logic is flawed. You want to promote investment in a place with nothing to invest by not investing in that place.
But furthermore, you want to do it in the name of fairness. You want to give Africa the same market opportunity that exists in America. That logic is also flawed, because there is no opportunity in Africa. So you're just letting companies with preexisting status hoarde all the opportunity.