  Recent work has pointed out the potential existence of a tight relation
between the cosmological parameter $\Omega_{\rm m}$, at fixed $\Omega_{\rm b}$,
and the properties of individual galaxies in state-of-the-art cosmological
hydrodynamic simulations. In this paper, we investigate whether such a relation
also holds for galaxies from simulations run with a different code that made
use of a distinct subgrid physics: Astrid. We find that also in this case,
neural networks are able to infer the value of $\Omega_{\rm m}$ with a
$\sim10\%$ precision from the properties of individual galaxies while
accounting for astrophysics uncertainties as modeled in CAMELS. This tight
relationship is present at all considered redshifts, $z\leq3$, and the stellar
mass, the stellar metallicity, and the maximum circular velocity are among the
most important galaxy properties behind the relation. In order to use this
method with real galaxies, one needs to quantify its robustness: the accuracy
of the model when tested on galaxies generated by codes different from the one
used for training. We quantify the robustness of the models by testing them on
galaxies from four different codes: IllustrisTNG, SIMBA, Astrid, and
Magneticum. We show that the models perform well on a large fraction of the
galaxies, but fail dramatically on a small fraction of them. Removing these
outliers significantly improves the accuracy of the models across simulation
codes.
