Make a jumper for hot and ground to a battery, pull the plug off the trailer, and science out what wire does what, then wire it up properly. Your brakes are getting power from the brake/signal lights instead of the EBC wire. It could also be in the breakaway kit.
Is your controller lighting up when you are having your brake issues? If it is, check the grounds. A gooseneck at work would lock the brakes as soon as you hooked it to the one truck. It would also lock them when hooked to my truck and any power was put to the trailer. Turned out the cord hadn't been unplugged and the truck driven away, the tug broke the ground wire in the junction box, and it was backfeeding the EBC to find ground.