It’s always satisfying when a clean solution can be found to a problem, that would have otherwise rendered a bike useless.
The assembly below was held in place by a single M5 rivnut (shown in the first photo). This is not very robust considering the rear brake is attached to it.
The solution was a threaded insert three times the length of the rivnut, bonded into the frame, then a bolt coming from the underside to pin it in place.
No visible change to the bike but it’s considerably stronger.