My Father in law has a 2006 Ford f250 and a 2004 cougar 5th wheel. He has had some problems with his brake controller/ brakes not working. He can take a 10 hour trip each way with no problems but then...
Crawl under the rear of the truck and see how the cord is wired to the truck. Mine was spliced into the wiring with those plastic slice connector. After a few years those connections corroded and I had intermittent brakes. Rewired it all and all is well.