I'm NOT 100% sure, but yesterday I added a plug to simulate that a trailer was connected to my 2020 GMC 2500HD Denali truck. I now get more camera views (side views) that are not available unless there is a trailer connected.
I added a 50 ohm resistor to the running lights and Right/Left/brake light terminals on the plug to the ground terminal. So on the plug I have 3 terminals with a 50 ohm resistor to ground. I then plug it in to the truck and started it up. Yep! A trailer was detected. I setup a new trailer profile, "Trailer Plug". Disabled the theft detection feature. The 50 ohm resistors where rated at 1 watt to be safe.
I determined the 50 ohm resistor by measuring the current from the trailer running lights when they were ON. About 1.1 amps. 14 VDC/ 1.1 A = 13 Ohms. To draw about 1/4 of that current, I increased the resistance to 50 Ohms. Then the power rating is about 14 VDC x (0.28A ^2) = 1 Watt.
With this all said- your problem could be an intermittent wiring issue on your trailer. Running light circuit or right/left/brake light circuits. Your electrical ground is routed thru the connector, so that could be intermittent as well.