Universal viewer display and login errors

I’m experiencing the same issue as in this old thread

However, we are not behind a proxy, and the advice in the thread doesn’t work. On investigating the manifests generated, some point to https://oursite.edu/files/medium/imageid/jpg

the ones that don’t work, however point to http://systemhostname for their ID’s, and lack a thumbnail block

Clearly, these mainfests are the cause, but what I can’t figure out is what’s causing them to generate differently. This appears to be a bug in the iiif server module. The images in question are hosted in the same way, directly on the box, and were imported from the same CSV, so are configured exactly the same. Deleting the manifest causes it to regenerate, and sometimes it will regenerate correctly, other times it won’t. Using Iiif server 3.6.26, omeka s version 4.1.1