Hi Carl,
It sounds like there is an issue within the charging system, or somewhere in the wiring harness. It could even be in one of the relays in the wiring harness, which could explain why the electric shift only works some times.
The fastest way to figure out the problem would be to have the electrical system checked at the dealership, but they charge for that service....
Troubleshooting the electrical system is one of the hardest things to do, without the correct tools and procedures. A repair manual for your TRX 450ES would give you the step by step instructions on how to isolate the problem.
You can follow this link if you are interested in getting one....
http://www.atv-411.com/honda-atv-repair-manual-17.html
Sorry I couldn't offer more help,
Ride Safe. Ride Legal. Ride Again... Curtis