Im gonna chime in on this as I just fixed this last week.2010 laramie so just as old.hopefully you have this fixed by now as I just stumbled on this post up.
My symptoms were courtesy/map lights worked with dimmer knob and key fob entry but not when I pressed them and went off as you described when either was on by pressing them.also noticed both vanity mirrors weren't working... everything would work sporadically.would never have noticed this it werent for the time change and the dam radio was so bright in the morning as it was dark out to leave for work and I went to find the button on the radio to dim it down and bang!,pressed the overhead light and it didnt work,I'm like wth!
I did a search here first didnt find an answer then googled it and stumbled across another fella from a another certain forum(ahem).... (alot of others described the same problem I found).
People chimming in saying dimmer switch,check the plugs of the lights up top..I did all that..nothing worked. That fella said he found it....wire inside if the visor chaffed through and was shorting...reason being occasional as mine was doing...unplugged that everything worked...had to replace the visor,$88 in my case and all is fixed...I shredded that visor afterwards and sure as sh**...chaffed wire.
Hope this helps or points someone in the right,shorter direction... drove me nutz for 2 weeks.