Its possible to repair it but it's a lot of work to do it properly and get a lasting repair, engine removal, splitting/stripping hole either plugged/welded and re-drilled this requires machining just not worth all the effort and expense.
You could try bodging but it's very likely going to fail in short order, sadly
you probably better off swapping the whole engine for another and selling yours for spares.
As for why it snapped could be a a few things out of alignment, too loose/tight, loose front sprocket, wrong size/type or poor quality (fakes) chain/sprockets or just a fluke and something got flung in there and snapped it
You could try bodging but it's very likely going to fail in short order, sadly

As for why it snapped could be a a few things out of alignment, too loose/tight, loose front sprocket, wrong size/type or poor quality (fakes) chain/sprockets or just a fluke and something got flung in there and snapped it
Later