Check that there is no difference in the position of the keyway with respect to the position of the magnet, between the 2 flywheels. If there is, that's your problem (now), but that doesn't explain why you had the ring gear problem in the first place.
Ensure that the flywheel nut is TIGHT (to B&S spec.). The key is only a locator - it isn't supposed to cope with crank torque. The taper should be sufficiently tight to prevent flywheel slippage. I have successfully assembled and run engines with NO KEY at all to demonstrate this to dis-believing students!
phil_saunders(a)bigfoot.com
Phil Saunders, November 2010