My 2006 had the same problem with the dome light. The light wouldn't go on unless you pushed on the switch.
I finally figured out how to fix it.
I just used a little bit of simple engineering.
The small switch in the light has some plastic parts that break off and allow it to drop down and lose contact.
If you take something the width and thickness of a wooden popsicle stick, cut it to approximately 1 inch long and glue it inside of the clear light lens so as to
be under the switch, it will hold the switch up making the proper contact. Okay--I confess, I used a piece of an actual popsicle stick and a little hot glue.
I did however round the cut end of the popsicle stick to match the original end.
My dome light works as good as the day the car was originally purchased and I fixed it for the price of a popsicle. No one has ever noticed it.
I do caution you as others have done-- the switch has a small spring and steel ball that are easy to lose.
Good Luck with it,
Novice