Masonry working in theme building, but not live due to page not loading?

I’m creating a masonry layout which is working perfectly fine when I’m building my theme using ghost cli.
Example:

Now in on the live side it’s not working, example:

What I’ve noticed is that the page in the theme building loads way slower and masonry only picks up after the loading time. Before things are loaded it looks like the second picture. This loading also happened before adding masonry. So it has nothing to do with that.

On the live side this loading simply doesn’t happen. It never occurred, but didn’t run into problems before.

I don’t see any errors in the console, when I check out the files that have been loaded in the network tab, they all include the right code. So there must be something different going on with loading things between the two applications.

I’m using docker as my live side.

Note: I have masonry working on another docker image with ghost just fine. So I can confirm this should be working. So I’m pretty sure it has to do with some kind of configuration.

Any help would be appreciated

Edit: I also checked the order of the files loading in the network tab. Also no difference there.