Funny to read of this on another truck. Thought mine was unique.
Bad battery, went dead awhile back. First time, put the charger on it, corrected and fired it up no issue. Thought I must have left someone "on."
A couple weeks later, same thing. Charged it up. Got in later, fired it up, backed up and noticed the only gauges working were the speedometer and tachometer. None of the other gauges worked. Shut the engine down and the radio kept playing (it's set up that way.) But, when I opened the door the radio should have shut off and it did not, it kept playing. Gauges not working when they should and radio working when it should not.
Got out he scanner, hooked it up and it would not connect to the computer in the truck. Hell, the computer was working or the truck wouldn't start up and run, but the scanner would not connect and indicated a computer issue.
Got to doing some reading on the computer and looking at some you tube videos and ran across some info about issues with relays in the fuse boxes. My truck is kind of simple so there are no power window/power lock relays in the fuse box on the side of the dash on the driver's side (one article indicated an issue with a door module relay). A guy said he got to randomly pulling relays out and putting them in and his screwy electrical issues went away.
I don't have those power door modules so I went to the big fuse box on the driver's side fender well under the hood and began pulling relays and putting the back in. Pulled all the relays (truck not running, key switch off) and put them back in one at a time. Went back to the cab, fired it up and all the gauges worked as they should and the radio would turn off like it should. Hooked up the scanner and it could connect/communicate with the computer like always. But it showed a butt load of electrical communication errors between systems. Went through and reset all of those and went back out to shut the hood and noticed the tag on the battery said it was two months short of 7 years old. Went out, bought a new battery and no issues in the last two months.
Good luck. Electricity does funny shit. And the more complicated the engineers make an electrical system the more screwy shit it's capable of doing to make your life worse. Key off, pull all those relays one at a time and put them back in. Put a new battery in it and see if it's fixed.