You will not like this, so sit down and get comfortable.
Best case: The sector switch (I think they call it) is a pie shaped position indicator on a shaft that comes out of the transmission under your left front door. (Drivers door in Texas). They get crudded up, corroded and need to be cleaned or replaced. I replaced two, then packed the last one with grease about six or eight years ago. Switch costs about $200 as I recall. Easy to replace, but messy if you use as much grease as I do.
Worst case: The sector switch and cable are fine, but the connector leading from the sector switch to the (almost) impossible to reach wire loom cable will be corroded because some dufus had to power wash his engine every month or so. That connector is between the bell housing of the transmission and the floor of the body. It only took me about a month to figure the ground wire was the problem, so I bypassed the connector for that wire only. Pins in the connector were completely corroded to nothing, not even dust.
There has to be a better way to get this done, like replace the corroded pins in the connector, but I did not have the pins, room to work or patience to do that. Besides, and I mean this, if I had to get at that damn connector again, I would seriously consider dropping the engine and transmission a foot or so. I am not kidding.
That was the time I packed every electrical connector I could reach with grease to help keep water out.
I hope that is not your problem, but it sounds like the symptoms I had before this cured it. Maybe just unplugging the sector switch connector, cleaning and greasing it, then reconnecting it will work for you.
Man, I hope I have this one wrong, and I can put stuff like this on here because I know more knowledgeable people than me will correct me.