Even with an old school filament light bulb, this probably wouldn’t have been enough to “warm” anything inside the refrigerator even if the light didn’t turn off.
For real, how long did he leave the refrigerator open for the bulb to noticably warm up? Dude's habits are wasting more energy than all the lightbulbs in his house.
The heat from those bulbs was used to keep the content over 0 degrees Celsius when the fridge got colder than the set temperature (e.g. very cold room in winter) to prevent the goods in the fridge from freezing.
That's what I know about this topic. Valid for Germany, don't know how this is handled in other parts of the world.
With the way bulbs are designed, all the heat is in the filament, and a bit gets transferred to the glass. The filament cools very quickly, hence it goes dark, and the glass is so thin that there isn't a meaningful change in temperature of the surrounding air once it's shut off.
Add that into the massive heat sink that is the contents of your fridge, not to mention the sheer volume of air that tiny amount of heat has to warm up..... Anyone legitimately concerned about it heating the inside of the fridge needs some refresher courses in science.
The smaller the fridge, the more it'll affect the inside, but it's still negligible.
I have no data beyond anecdotal experience, so if someone wants to set up a scientific study, I'll happily skim the abstract and make sweeping judgements about the content!
40w is a lot of energy going into such a small space though! Granted, its off most of the time anyways but that's still a lot of energy (and therefore heat)