There is a recall for the brake light switch, there is a new, improved switch available, which the BMW dealer should replace for free: Recall 00V048000: Brake Lamp Switch Defect
If you bought the switch from the dealer it should be the updated part already, and they should advise you about the recall...
You really need to get it diagnosed by a BMW specialty shop to see what causing the problems. They should be able to pull out diagnostic trouble codes from the affected modules and be able to estimate the parts and repair cost for you.
Zee