They have to be swapped somewhere.
Do you have a wiring diagram of the trailer side ?
I assume that the square connectors have a "key" for proper alignment ?
Was the input connector for the module already on the bike......or did you install that too ??
The transposition could be all the way back there.