Yep things like that happen! I’ve had one come apart on a rusted swingarm when I put on the brake. It pulled the cable, rapped it around/got caught in the chain and sprocket locked up the wheel.
It pulled the handlebars to the left, went into skidding drift, Didn’t lay it down but back hurt for days because I had to lift up the back of the bike to push it home almost a half mile.
Looks like you may be able to weld that back on but you may need a fork tube/forks, hope you don’t have any more damage to your bike or yourself,
Not sure how it would fit (Maybe too tall) but if you do need forks a good upgrade would be forks and disc brake set up from a revival or streetmate they come up for sale a lot here or you could post for a set