1997, fuse #27 in cab fuse box is for dome light
Dome light looks to be Grounded at the bulb, so pull out the bulb and test for good ground.
There is a 5 pole relay for the Dome light, when this relay is OFF it passes 12v from the Dimmer to the Dome light when dimmer is turned all the way
When you open the door GEM module activates this relay and passes the 12v to the Dome light.
So the 3 things in common for no dome light are:
GROUND at the bulb
Fuse #27
Relay
But the relay doesn't need to be activated for the Dimmer wheel to turn on the bulb, but it is possible for a 5 pole relay to fail and not pass the 12v in either position on/off.
This relay is in Relay box 1 just above gas pedal area under the dash, there are a few relays in there, I don't have a diagram of which is which.
I didn't include bad bulb..............because I assume you have tested it already