What kind of joints are you setting up? Box2D is an iterative impulse based solver, so sometimes if you place too many joints in a specific way the system will be unsolvable and cause erratic behaviour like this.
Each ball has a weld to the white square which has an axis connected to another ball that is static in the middle. It works fine but as soon as the Revolute joint is put on and unfrozen it goes crazy…