I can see how that g is bad.
But why is vcat(x,y) in any way uncertain? (Although this might be orthogonal to OP’s problem.)
More importantly, what does “structure” mean here? My NamedTuple examples wrap Duplicated and Const things into the same struct, but probably don’t “store” anything, it’s not an array & has no pointer. Is that always OK?