OH MAN !!! I dont have a solution for you, but I feel your pain. Can't listen to the radio with the ignition off , can't leave the keys in the ignition. DOME LIGHT!! What a pain!
I don't know for sure on these trucks, but most newer Fords have the switch integrated into the door latch mechanism.
Try spraying it down with contact cleaner of WD-40...if that fixes it, you can decide whether it's worth replacing the switch, or just re-spraying if/when the problem reoccurs.
We usually use a scan tool to check door switches. But I recomend lubing them all and opening and closeing the doors a bunch of times to see if the light goes out. I'd say most of the time it's the driver door.
Same problem here, I soaked down the latches with liquid wrench, worked the doors a bunch , and the door ajar light stays on. Id like it to work properly , My kids ride with me sometimes, and I dont want them to fall out an open door