We use weak gravitational lensing to measure mean mass profiles around Locally Brightest Galaxies (LBGs). These are selected from the SDSS/DR7 spectroscopic and photometric catalogues to be brighter than any neighbour projected within 1.0 Mpc and differing in redshift by $<1000$ km/s. Most ($> 83%$) are expected to be the central galaxies of their dark matter halos. Previous stacking analyses have used this LBG sample to measure mean Sunyaev-Zeldovich flux and mean X-ray luminosity as a function of LBG stellar mass. In both cases, a simulation of the formation of the galaxy population was used to estimate effective halo mass for LBGs of given stellar mass, allowing the derivation of scaling relations between the gas properties of halos and their mass. By comparing results from a variety of simulations to our lensing data, we show that this procedure has significant model dependence reflecting: (i) the failure of any given simulation to reproduce observed galaxy abundances exactly; (ii) a dependence on the cosmology underlying the simulation; and (iii) a dependence on the details of how galaxies populate halos. We use our lensing results to recalibrate the scaling relations, eliminating most of this model dependence and explicitly accounting both for residual modelling uncertainties and for observational uncertainties in the lensing results. The resulting scaling relations link the mean gas properties of dark halos to their mass over an unprecedentedly wide range, $10^{12.5}<M_{500}/ mathrm{M_odot}<10^{14.5}$, and should fairly and robustly represent the full halo population.