Might be time to take a look at the pigtail that the LEFT side uses - for it's rear brake light.
Did you replace the Right side bulb? Make sure it's seated in the housing - and if the units' looking aged, like some heat has been applied (brownish tint to the whiter or lighter color plastic socket) then the wiring and the contacts need to be checked to make sure ALL those wires on that bulb connect.

The symptoms sound like a bad ground return wire. When the lights are on, on a badly (poor or not) grounded system - the ability of the lights to turn on is possible - even from the returns of the other lights in the circuit that can allow power to flow thru those filaments into the ground wires at the other lights. This includes the return for the running light (tail-side) even when the Stop-light side is not working (
on that same circuit at the bulbs socket).
- Then why does it go off when you apply power (your Brake light) ?
- Deals with the differences and how current can flow across a wire that can be powered on BOTH ends of itself - if there is no potential difference - no electrons will flow or will there be any work those electrons with do to make anything light up.
- Both ends? OK, remember those bulbs above? They have contacts to the filaments - each filament can be treated as it's own circuit - so 4 contacts make two circuits (one in, the other is the out, makes 2-pairs) these contacts also can be tied together outside of the bulb and reduce wire count - so they call this combining a type of splice or joint. for electrons to pass thru and produce work. (Your light)
-
- So the bulbs are fed power thru two different wires one functions as stop light (Brake) while the other works like your running light or Tail-light.
- When the grounds are open - as in there is no return to complete the circuit at the lamp...the lamp can still use the other lamps tied to this same circuit from the Body control Module to let power flow into ground using those other filaments the others bulbs have - as wires in and thru to ground at those other bulbs.
-
The Light goes out because there is no difference in voltage in the bulbs contacts and the wire now, so no power flows - it's static, meaning it's power doesn't go anywhere. The bulb goes dark because of the loss of potential difference in the wire it was using to find ground thru those other filaments using those other bulbs that were not lit - is now powered at the same power level the other filament is in that bulb - so it's like there's no power flow. It's caused by that loss of difference - even though power is able to be applied - it can't do anything - it just sits there so the filament can't light up.
- - their filaments when cold work like short circuits - when they are heated - they provide work and increase their resistive impedance in the circuit preventing them from letting all that power from the bulb missing it's ground to flow thru them.
- - therefore letting power flow thru them when not powered lets that other filament of that one bad bulb still find a way to ground and produces light (work) because of the other cold filaments are acting like dead shorts to take up that leaking power.
- - if you have enough bulbs in the same circuit - they will act like the dead short for the no-ground that bulb had and those others will remian dark even though power flows thru them - there is not enough power from the filament to power all those bulbs to lite up but the other bulbs provide the return to ground because their filaments help complete that circuit the bad bulb needed to work it's filament - the load across the bulbs help with ohms law in resistance in parallel - each resistor or element sees less power because the power flowing thru the circuit is reduced by the number of elements in parallel in the circuit to carry that power across themselves.
- - as the ground for that bulb working like the ground for that no-ground bulb - the power flowing thru the wires to those bulbs is reversed - so when the wire is powered from a different source (the cars brake light wire not the bad bulbs filaments) the light goes out because the wire now powers all the bulbs and swamps out the current flowing from the bad bulb so it (that bad bulb) goes dark - due to that bad bulb's filaments can't see any difference.
For a 5-door (hatchback)...has a 5-wire (function) system Left Turn,Right Turn, Stop, Tail (Running light) and Reverse (Backup)
Or another way...
Some 4-door sedans use this scheme (shown below) - a 4-wire (Function) COMBINATION light - meaning that the Brake and Turn are the SAME bulb so when you use the brakes, they both light up, but when you use the turn signal - on that side, the brake light only flashes - does not stay on, for that side - meaning it's a combination - so the other opposite side brake light and the third brake light high-mount stop lamp - does "the show" to let drivers behind you see your intent.
IF you live in the UK or EU some countries require the use of a rear "fog" light as a marker light to help others see you.

Make sure the bulb is inserted into the socket all the way, fully seated. May need to have someone to press on the brake pedal while you have the bulb and socket out so you can wiggle and press the bulb into the socket to observe any interruptions or intermittent operation - if you see that type of condition, you will need to investigate further.
Sadly heat causes the plastic in the socket to deform and due to the metal contacts and their spring tension, they may lose contact over time, this is a common problem that requires replacement of the socket and install a new pigtail, which is a more dedicated service and repair. Yes - you can do it but the effort requires some tools and skills many don't have.
Otherwise, you will have to check the pigtail-connector that connects both sides the left and right at the branch for the lights and it's inside the cars trunk - by the Left rear tail-light.
It can be the above, or something more exotic like a pre-molded base socket and connector assembly that fits the tail-light

So, you ready?