It fails because the MemoryStack in LWJGL grows "downwards", i.e. if you stack allocate A then B of the same type, they will be contiguous in memory but B will have a lower memory address than A. This is unspecified, just like you can't assume anything about two local variables in C declared next to each other. You can probably get away with using the fragment shader address instead, it should work, but there are no guarantees it won't break in the future (if the MemoryStack implementation changes for whatever reason).
Not sure what your goal is, but if you're trying to minimize local variables, the struct DSL allows it, like this:
VkPipelineShaderStageCreateInfo.calloc(2, stack)
.apply(0, vsh -> vsh
.sType$Default()
.stage(VK_SHADER_STAGE_VERTEX_BIT)
.module(createShaderModule(vshCode))
.pName(stack.UTF8("main")))
.apply(1, fsh -> fsh
.sType$Default()
.stage(VK_SHADER_STAGE_FRAGMENT_BIT)
.module(createShaderModule(fshCode))
.pName(stack.UTF8("main")));
and you pass that directly to VkGraphicsPipelineCreateInfo::pStages().