Follow ATC4ever's tips as that would be the simplest solution! However if that doesn't work here is some more info
Firstly ill tell you wheelsquad is 100% correct on this one... these bikes (04-07 Rancher 400AT/FGA/FA) take alot of patience and messing around with. Reason being is the hondamatic; now to your question. Shift sensors; there are technically 4 sensors to do with shifting in a hondamatic system - the angle sensor for determining the position of the gear lever (D,N,R Lever), and the D, N, and R gear position indicators for each gear position. However, there are more components that should be of concern if your running into said issue, things like the ECM and shift motor can also have issues.
I had the same problem back about a year ago. It happened when I started riding in water, and I ended up frying the shift circuit in my ECM (basically when a shift signal is sent to the ECM(computer) to tell the motor to shift the bike, it wouldn't do anything but display an error code because the circuit was shorted out.
My best advice (same advice I followed to fix my problem) is refer to the last manual section "Hondamatic" and follow all the steps for the "--" blink code that your getting. Its a process of elimination. Best of luck!
Sidenote - If you don't have the manual look up "Honda Rancher 400 AT 04-07 manual" you should be able to find a downloadable pdf, or message me directly and I can get you a copy.