I would expose those wires, and use a test light or voltage meter on each wire to determine the 3 functions of the tail light.
If you have all 3 functions the wires are probably crossed, and you can resplice them accordingly.
Also check continuity from those wires to the bulb socket.