In my experience with magnets, if you put the magnet on the sensor upside down, the lights will turn on when you close the fridge door. To make sure that's not happening, open the other door to check.
E.g., put the magnet on top of both sensors. When both doors are open, the lights should be off. Now close only one door at a time. If you close the left door and the light turns on, flip over the magnet above the left sensor.