The brakes themselves are fairly simple electrically, so I'd look for a loose wire or possibly a controller problem. Try duplicating the problem in your driveway. If your trailer lights are also going on & off with the brakes, then it's almost certainly a wire problem since the controller doesn't work the lights. Also, look at the controller readout & see if the brake number changes or stays at zero.
'06 F350 TD, Softopper, airbags, AeroShield, coolant filter
'10 3665RE Hickory edition, wetbolts, Firestone LTs, Trimetric Battery Monitor, 4x100w panels & Morningstar TS-45, still tweeking.