Using tens of thousands of haloes realized in the BAHAMAS and MACSIS simulations produced with a consistent astrophysics treatment that includes active galactic nucleus feedback, we validate a multiproperty statistical model for the stellar and hot gas mass behaviour in haloes hosting groups and clusters of galaxies. The large sample size allows us to extract fine-scale mass–property relations (MPRs) by performing local linear regression (LLR) on individual halo stellar mass (Mstar) and hot gas mass (Mgas) as a function of total halo mass (Mhalo). We find that: (1) both the local slope and variance of the MPRs run with mass (primarily) and redshift (secondarily); (2) the conditional likelihood, p(Mstar, Mgas| Mhalo, z) is accurately described by a multivariate, lognormal distribution, and; (3) the covariance of Mstar and Mgas at fixed Mhalo is generally negative, reflecting a partially closed baryon box model for high mass haloes. We validate the analytical population model of Evrard et al., finding sub-percent accuracy in the log-mean halo mass selected at fixed property, ⟨ln Mhalo|Mgas⟩ or ⟨ln Mhalo|Mstar⟩, when scale-dependent MPR parameters are employed. This work highlights the potential importance of allowing for running in the slope and scatter of MPRs when modelling cluster counts for cosmological studies. We tabulate LLR fit parameters as a function of halo mass at z = 0, 0.5, and 1 for two popular mass conventions.