With your bike turned off, In neutral your bike will easily go back and forth. In gear it will only roll backward.
If you have trouble shifting between gears with the bike off then follow my earlier post but keep in mind it’s normal to rock it to complete the gear change while the bike is off.
It’s possible you have two separate problems. Nothing electrical keeps a manual shift bike from shifting so it would be a mechanical problem.
If the bike is running and idled too high then that would make it hard to shift.
The wires off the back of the engine are for the stator/generator and the smaller one is the gear switch indicator. The shift indicator could possibly be bad if it showing neutral and reverse lights at the same time but has nothing to with your bikes physical ability to shift. You can inspect it for a bare spot or grounding issue and unplug it and clean the connector and add dielectric grease to the plug. Confirm you aren’t having a mechanical shifting issue first before determining that something is wrong with the shift indicator.