  The thermal Sunyaev-Zel'dovich (tSZ) effect offers a means of probing the hot
gas in and around massive galaxies and galaxy groups and clusters, which is
thought to constitute a large fraction of the baryon content of the Universe.
The Planck collaboration recently performed a stacking analysis of a large
sample of `locally brightest galaxies' (LBGs) and, surprisingly, inferred an
approximately self-similar relation between the tSZ flux and halo mass. At face
value, this implies that the hot gas mass fraction is independent of halo mass,
a result which is in apparent conflict with resolved X-ray observations. We
test the robustness of the inferred trend using synthetic tSZ maps generated
from cosmological hydrodynamical simulations and using the same tools and
assumptions applied in the Planck study. We show that, while the detection and
the estimate of the `total' flux (within $5 r_{500}$) is reasonably robust, the
inferred flux originating from within $r_{500}$ (i.e. the limiting radius to
which X-ray observations typically probe) is highly sensitive to the assumed
pressure distribution of the gas. Using our most realistic simulations with AGN
feedback, that reproduce a wide variety of X-ray and optical properties of
groups and clusters, we estimate that the derived tSZ flux within $r_{500}$ is
biased high by up to to an order of magnitude for haloes with masses $M_{500}
\sim 10^{13}$ M$_{\odot}$. Moreover, we show that the AGN simulations are
consistent with the total tSZ flux-mass relation observed with Planck, whereas
a self-similar model is ruled out.
