Well from your desription the power and ground circuit for your lamp is good since it works with the switch. Your vehicles door use a switch to let the car know when a door is opened. Some can be built into the latch and some are spring loaded pins that when the door is closed they push the pin and the lamps go off. These switches/pins either control ground or power to the lamps. Some quick checks you can do is, Is door ffunction for the lamp turned off?, does it work with any door or just one door? If the vehicle has a door chime to let you know if the door is open, does it work? Does this problem come and go or is it always? If always it is probably a dead fault meaning its easy to find. If it's intermittent then it could be a loose connection, corrosion, or damaged wiring being shorted or opened. Hope this will put you in the right direction, most vehicle use a negative trigger for the door switches meaning they apply a ground to the lamp circuit when door is opened