so lets start with the basics,
What engine ? brand & model numbers please.
The magneto is self powering but the cut out switch is not.
You should have some relays and they need power or they default to OFF.
You replaced the stator but did you also replace the rectifier ?
Depending upon the model some have the pins in different positions.
A faulty solenoid can also burn out the ignition switch.