if before 5th is flaky but after 5th is fine, your problem is likely the before 5th selector lock trip relay switch R2 (manual page 65).
you can verify by:
- enable squares with the standard before 4th lit
- wait for problem to happen
- manually trip the yellow rollover trip relay (a wooden meat skewer is handy to poke into the trip bank and release the armature plate)
- if squares work, suspect before 4th selector lock trip relay switch L4.
- if squares don't work, manually trip the red rollover trip relay. If squares work, R2 as above
- if squares still don't work, it's something else like after 5th trip relay R1, a tilt trip relay switch, etc.
access to switch R2 is awkward. If you aren't using a moto-tool with a wire wheel to clean switch contacts, t's usually easiest to unscrew the entire stack and remove it to get to the contacts with a burnishing tool. When screwing the stack back on, tighten the screw nearest the switch blades first, then the other...and don't overtighten...the screws are soft.
to adjust the switch, you often need to remove an adjacent switch stack to get access to the blades with an adjusting tool.