each door has a switch. Cherokee. XJ. Gas not diesel, USA not export or police car.
test the switch that fails.
there are 2 ways.
any DMM on slow resistance ohms scale, called "continuity check"
or use live voltage checks.
many cars , the door closes and the voltage goes to 0volts.
alldata.com and the FSM show what to do, just read the book step by step.
seems the wiring to front dome is failing.
to find that use a schematic,.
this makes finding any electrical problem easy.
alldata. com and the FSM have that.
try here.
for free, posted 100s of times now. here.
http://www.jeep4x4center.com/knowledge-base/index.htm?utm_source=cj#service
all answer, USA , non export models. and never ever stated here by any poster. ever. 1` in 10,000?
click wiring
click PDF page.
233 the lamp page
as you can see the 2 lamps get power from the same fuse.
so that path is not bad.
as you can see only 1 lamp has a local ground (manual) switch.
all other lamps are in parallel and must all work in unison.
id say pin B is broken to lamp. sure would.
page 236 shows the lift gate switch and sure a heck, is 0v
closed, and yours works a, you said the other lamp works via this hatch. switch.
so the problem is above the lamp or any wire to pin B bad.