I have the same issue with my 2024 sierra 3500. I get the “check trailer wiring” “service trailer brake system” intermittently. I spent $700 bucks to have the entire trailer re-wired from the pigtail to the axles which didn’t correct the issue. My dealer is Dave Smith in Idaho and they have been good to work with so far on the issue. They couldn’t identify anything with their trailer simulator or pull any codes but they were able to find a service bulletin #23-NA-113 that may identify the issue specifically on 2024 2500s/3500s. The service bulletin states the trailer solar panels may charge the trailer batteries to a level higher than the truck battery and cause it to backfeed to the truck which places the trailer brake module into a “safe mode”. It also says that GM is working on a solution but I’m not holding my breath.
I haven’t had much of an opportunity to test it myself; but you can try turning your battery disconnect switch to “off”, shutting off your solar controller, or disconnecting your solar panels to see if it resolves the issue.
This issue is driving me crazy after a recent 600 mile trip with intermittent trailer brakes so I’m hoping for a quick fix and not the bandaid solution provided in the service bulletin.
edit: added 2500s to the list of affected trucks