Well I'm going to show off now and say I have never had to do that
When I see the brick/stone crumbling behind the back box I do the following...
1. Panic.
2. Slowly stop panicking.
3. Slow everything down and become very gentle with the remaining brick.
4. Drill new holes in the back box itself if needed, where I know there is good brick behind.
5. Drill out new holes in the remaining brick, starting with a smaller drill bit and working up, preferably not with hammer action.
6. Huge sigh of relief when 2 of the screws take a firm hold!
7. Cup of tea.