since you just swapped everything to a newly painted frame, i'd suspect you didn't sand down to bare frame at the grounds, mainly the ground at the coil for ignition, but also at the voltage regulator for lighting ?
(all black grounds connect together inside the harness anyway)
the coil also needs grounded to bare metal frame inside it's mounts
the other causes of backfiring are bad reed petals and a sheared/missing woodruff key in the flywheel