Red wire is permanantly live from battery to ignition switch.
Black is switched live, only live when ignition is on. The battery does not feed the CDI module.
The generator feeds the CDI directly, not through the ignition switch. Soon as you kick it, the CDI is getting power.
The bike cannot start with ignition off, because the black and white wire from the CDI is connected to the green ground wire within the switch when it is off. The CDI capacitor within is therefore grounded and cannot build up a charge to send to the ignition coil despite it getting power from the generator.
Disconnect the black and white at the switch and you should have spark regardless of the other wires to the switch. If not, the fault is elsewhere.