This may help, schematically...
Power distribution section
F18 in the Fusebox in the main engine bay - powers Stop lamps (Brake lights)
From the Body Control Module Perspective...
For Four Door (Sedan with COMBINATION lights to single light (STOP - TURN to 1 light)
For Hatchback - 5-wire...
The Body control Module monitors power being applied at the output and in it's diagnostic, looks for open lines due to power draw is less when the circuit is open. So it senses this and tells you to check your taillights.
So to me - to even tell you to check lamps, you may have an open wire or corroded socket, which you swapped to find the opposite side tells you it works.
So the open wire should be at Ground-point or connector to Body Control Module in the harness.
Hope this helps.