Magnetic-buoyancy-induced mixing in AGB stars: Fluorine nucleosynthesis at different metallicities