Not excactly support per-se as I’ve solved this issue now but I’m still very confused about what was exactly happening. I have two pages on my site that I have custom layouts on, for instance on the gallery page:
---
layout: gallery
---
And I was keeping the corresponding layout file in layouts/page/gallery.html (it has been a long time since I made these templates so I don’t remember where I read about this method). This worked on my local system but I found that when building on my server with I believe the same version of Hugo it was basically a coin toss whether or not Hugo would decide to use the gallery template on this page. It would never give any errors either. So on occasion after updating my site content the entire page would just disappear and use the default layout template. I fixed it once by updating Hugo but then later it happened again.
I have now switched to using the more proper layouts/gallery/single.html and everything seems to work fine now, but I’m a bit disturbed that Hugo builds might not actually be entirely reproducible.
Any ideas what was happening? It seemed to be happening on v0.148.1.