There has to be something beside the blinker switch that ties the brake light wiring in with the turn signal wiring. If it has both front and rear turn signals it often involves 7 wires. There are various ways to accomplish this, one is using a converter box designed for trail lights. I'll post an example of that wiring setup, but yours could be entirely different. Are the brake wires color coded different from the other wiring so you can trace it back to the turn signal switch?
There is a toggle switch available for turn signals that may be what the OP has. American Autowire 500148 https://www.americanautowire.com/shop/toggle-turn-signal-switch
A good idea on some of the wiring would be heat shrink tubing. With the pull-apart connectors it should be easy to slip a piece on each side of the connection.
A couple of observations:
Hopefully someone did not misconnect the ground and hot wires. More likely they connected the rear light feed to the brake light and vice versa.
The bulb that has the two bayonet pips opposite each other and not offset can be fitted the wrong way around.
I don't know what is exactly the case here, but if that unit with the wires misconnected is the same side as the bulb with the non offset pins, then the wires may have been correct all along, just the bulb was the wrong way around.
The lamp units receive two feeds, the ground return is via the car's body and frame.
Mart.
Did you use a new bulb ? Retread Marts comment #53 post