  The detection of the 21-cm signal at $z\gtrsim6$ will reveal insights into
the properties of the first galaxies responsible for driving reionisation. To
extract this information, we perform parameter inference which requires
embedding 3D simulations of the 21-cm signal within a Bayesian inference
pipeline. Presently, when performing inference we must choose which sources of
uncertainty to sample and which to hold fixed. Since the astrophysics of
galaxies are much more uncertain than those of the underlying halo-mass
function (HMF), we usually parameterise and model the former while fixing the
latter. However, in doing so we may bias our inference of the properties of
these first galaxies. In this work, we explore the consequences of assuming an
incorrect choice of HMF and quantify the relative biases in our inferred
astrophysical model parameters when considering the wrong HMF. We then relax
this assumption by constructing a generalised five parameter model for the HMF
and simultaneously recover these parameters along with our underlying
astrophysical model. For this analysis, we use 21cmFAST and perform
Simulation-Based Inference by applying marginal neural ratio estimation to
learn the likelihood-to-evidence ratio using Swyft. Using a mock 1000 hour
observation of the 21-cm power spectrum from the forthcoming Square Kilometre
Array, conservatively assuming foreground wedge avoidance, we find assuming the
incorrect HMF can bias the recovered astrophysical parameters by up to
$\sim3-4\sigma$ even when including independent information from observed
luminosity functions. When considering our generalised HMF model, we recover
constraints on our astrophysical parameters with a factor of $\sim2-4$ larger
marginalised uncertainties. Importantly, these constraints are unbiased,
agnostic to the underlying HMF and therefore more conservative.
