Hi,
Fuel contains dissolved air which will bubble out of solution when pressure is reduced. With gravity feed, there is a lower pressure in the fuel line due to the "suck" of the engine driven fuel pump - causing cavitation.
After some time at high altitude, the dissolved air will naturally come out of solution allowing gravity feed.