The bulbs have lost contact with ground. When you hit the brakes the bulb is seeing 12 V on both terminals so the lights go out. bg
X2!! Check the ground on the bulb sockets.
Should be fine. bgwould it matter if i cut the ground on the socket and ran my own?