I would rule out the ground issue first, as it's most likely.
The flasher module is just that a flasher, it flashes the same on right or left. At least on the 03/04 and newer TJ's. So likely a ground, especially, when the function changes (your lights come on). Prolly a chafed wire behind that lamp. Or not far from it in the harness.
But the flasher is a pluggable module (depending on your year of heep), and I recall, its about $20, I went thru one when I did my LED lights, and I had to mod the new one so it wouldn't fast-flash like a bulb was out.
You could try with a multimeter to map out the functions of the various wires behind the one that works, then try on the one that doesn't. that will at least lead you to a bad wire, then finding the fault will be fun.
But a trailer harness makes things easy, especially if it T's into existing wiring, a trailer light tester will give you a fault which you can trace.
Wiring, its like a pipe, but smaller and bendy!