Also, the wiring harness is a "modular design" meaning that the same wiring harness is used for trucks with/without the 7pin/4pin connector. There is a "plug on the truck harness" behind the bumper. The trailer connector you see on the bumper plugs into that harness. There may be corrosion/water in that plug. So, crawl under your rear bumper, disconnect that plug, let it dry, apply di-electric compound to the terminals and re-connect it.
In Ford/Keystone combinations, there has been some history of "plug mismatch" between the truck 7 pin and the trailer 7 pin connectors... Ford's plugs are manufactured by one company and Keystone's "low bid umbilical harness".... A slight difference in tolerances between the truck/trailer connector pins can sometimes cause a problem with "computer monitoring of the connection".... I replaced the trailer 7 pin connector with a "quality aftermarket plug" and it solved all of my "disconnect messages"....
I'd first crawl under the truck and check that connector, then consider changing out the trailer umbilical plug for a "better, more reliable brand".
ALWAYS, ALWAYS keep di-electric grease on all exposed metal ends of both the truck and trailer connectors !!!!!
2015 F250 6.7l 4x4
2014 Cougar X Lite 27RKS