Definitely getting the truck brakes checked out was a good start. Now that you know they are good it's time to focus on the trailer.
Maybe the truck brakes never failed. The problem is the trailer brakes failed and the weight of the trailer was too much for the truck to stop alone.
Could you have driven over something in the road that broke the brake wire under the trailer? I would carefully inspect the umbilical cord for any damage. Then crawl under the trailer and follow the brake wires seeing if anything is cut or broken.
Yes the problem could very well be in your 7 pin. Have you recently had issues where the trailer lights sometimes don't work until you unplug and replug the connection multiple times?
Maybe hook the trailer back up and pull it at about 10 mph and slide the manual lever over full. Do the trailer brakes seem to engage?