Metal-rich environment crucial for light giant planets, but not for heavy giant ones: Study