Trailer sway during braking could indicate faulty brake wiring connections at one of more trailer wheels. Use a circuit tester to confirm voltage at the connections. If no voltage is present at one, but is present at others, the problem is in the trailer’s wiring.