What MephistonX says is very true.
I'm not aware of your whole situation ( Like why one layer is Shape layer and other one is vector mask... ), but assuming that the priority is to have the gradient covering the visible area of the layer and since it is a vector mask, I would probably make that vector mask into a shape layer:
This is what my image looks at the moment.
Click the vector mask in your Layers panel to select it ( if not already selected ).
Take any of the Path tools, e.g. Rectangle tool. Make sure that path is selected and then click the shape button.
The above will create identical shape layer out of vector mask.
You can then copy the Layer styles from your original layer by dragging the FX from one layer to another, while pressing Alt key ( Or just drag it without alt, if you don't need the original layer anymore ).
The method that MephistonX mentioned, basically does the same thing, but you end up with a raster layer.
Since you have Vector mask, you need to do it like this:
Right click the Vector mask and select Rasterize vector mask
Right click the mask, that is now Layer mask. Choose Apply layer mask.
If for some reason it is still not working, go to the blending options > Gradient overlay , and make sure that you have Align with layer checked.