Gradient shader according to the polygons size
You're using generated texture coordinates.  Generated texture coordinates are generated by looking at the bounding box of your object (before any deforming modifiers, but after any generative modifiers).  They range from 0 at the bottom, left, front of your object to +1 at the top, right, back of your object.  Because your drawer has a different bounding box, this means they are different coordinates.
You can revise your existing material to use different coordinates, although this is going to require some other editing.  Probably simplest is to make all objects from the material use the object coordinates of the larger cube.  However, object coordinates range from -1 to +1 instead of 0 to 1-- or at least, for your purposes they will-- and so you'll probably need to map them a bit: