Many squat racks and benches come with safety features to prevent that kind of failure. Don’t let that fear stop you from getting a home gym. To avoid really bad situations just always have a safe solution to “what if I can’t finish this rep“. Separately, you’ll get regular injured at some point doing something totally safe. But that just comes with the territory.