OK. Indeed, according to the wiki, the RAM requirements seem to be significantly higher for building lineage-18.1 and later.
Then again, even for lineage-16, I fall short of the recommended 16 GB by far. Of course the building probably takes longer, as the system might be forced to swap every now and then, but I wonder why it should fail altogether ... Anyway, good luck with your new box! 🙂