I’ve had an issue for the last little bit with flickering and occasionally and randomly not working trailer lights. Lights would go off and on with large bumps on the interstate. Usually the white Phoenix lights on the side which I think are the same circuit as the tail light.
Start hunting bad connection. Truck is fine. Plug is fine. Connection in break away tongue is fine. Wiggle tongue, works/flickers. Look for another connection. There is none. Look to ground wire. Clean it well. Same issue. Wiggle tongue... work/doesn’t/flickers. Figure ground is getting to tongue but losing connection at the break away tongue without a good constant connection. Test with wire from tongue ground to marker light ground on front of trailer. Success.
Run a ground wire through the tongue breakaway tube to the port side front marker light screw if you have any flickering trailer light issues.