Traditionally, galaxy clusters have been expected to retain all the material accreted since their formation epoch. For this reason, their matter content should be representative of the Universe as a whole, and thus their baryon fraction should be close to the Universal baryon fraction. We make use of the sample of the 100 brightest galaxy clusters discovered in the XXL Survey to investigate the fraction of baryons in the form of hot gas and stars in the cluster population. We measure the gas masses of the detected halos and use a mass--temperature relation directly calibrated using weak-lensing measurements for a subset of XXL clusters to estimate the halo mass. We find that the weak-lensing calibrated gas fraction of XXL-100-GC clusters is substantially lower than was found in previous studies using hydrostatic masses. Our best-fit relation between gas fraction and mass reads $f_{rm gas,500}=0.055_{-0.006}^{+0.007}left(M_{rm 500}/10^{14}M_odotright)^{0.21_{-0.10}^{+0.11}}$. The baryon budget of galaxy clusters therefore falls short of the Universal baryon fraction by about a factor of two at $r_{rm 500}$. Our measurements require a hydrostatic bias $1-b=M_X/M_{rm WL}=0.72_{-0.07}^{+0.08}$ to match the gas fraction obtained using lensing and hydrostatic equilibrium. Comparing our gas fraction measurements with the expectations from numerical simulations, our results favour an extreme feedback scheme in which a significant fraction of the baryons are expelled from the cores of halos. This model is, however, in contrast with the thermodynamical properties of observed halos, which might suggest that weak-lensing masses are overestimated. We note that a mass bias $1-b=0.58$ as required to reconcile Planck CMB and cluster counts should translate into an even lower baryon fraction, which poses a major challenge to our current understanding of galaxy clusters. [Abridged]