I think what @clattner has explained in Unexpected Memory Values When Using C Bindings in Mojo - #2 by clattner about C ABI hell regarding passing structs by-value is the issue here as well.
Unfortunately, since I’m creating bindings for an existing third-party library I can’t just switch to use pointers. I was able to add a little c shim though, which makes the build a bit more complicated but seems to work fine as a workaround.