This has happened to a bunch of people - mine went out when the car was pretty much new - it was a microswitch in the assembly.
Dealer replaced this in my car 25167563655 but it is a $500 part - not sure if you could take it apart and fix/replace the microswitch itself, but I would try before spending the money on the whole part.
2008 E93 335i, MHD, HPF IC, Injen Intake
2016 X5 M-sport 35i JB Stage 1
2013 Mercedes C63 AMG ROW airboxes, power pipe, Eurocharged V6 Flame tune 540 HP