sounds liek you missed an earth after changing the box and things have earthed where they shouldn't have.
the brown wire to the coil runs to the chunky wire to the battery -ve, along with a load of other sensor/ecu earths. check the battery -ve to the stud on the rear gearbox -> engine bolt is connected, and take the battery tray out and check the earths under there are all good too.
however if the coil earth has burnt out you may have to unwrap most of the engine loom to fully repair the wiring damage
