Ian, there's many a thread on this. Once everything has been checked and set, it works perfectly every time on a Gen 3 or 4.
From memory: someone else may chime in with other bits I've forgotten.
1. Set Chain Tension properly. All new chains including the M Endurance chain stretches at the beginning.
2. The Gen 4 has a cover over the clutch switch so that shouldn't be an issue. Gen 3 it was a problem when people changed levers.
3. The Clutch Cable free play at the lever is practically zero when cold, check this, clearance is created as the engine warms. Again the cable will stretch if the bike is relatively new. Even though you aren't using the clutch lever, the micro switches need to be in the correct place i.e closed.
4. You can train the Gearbox: Start engine in Neutral on a rear paddock stand. Leave in neutral for 10s ie count ' 1 one Thousand ' etc, using the clutch put it in first and let the clutch out for 10s, then 2nd, 3rd 4th, 5th, 6th gear with 10s in between and using clutch. No need to rev. Back down to first, then put it Neutral key off.