Let’s say your switch has four settings: “off,” “one,” “two” and “three.” When you set the fan on “three,” the highest speed, there’s no resistor used. All the current passes through to the fan motor, and it runs at its highest speed.
When you turn it down to setting “two,” a resistor engages, limiting the amount of electricity going to the fan. When you set it on setting “one,” an additional resistor cuts the power even more.
So, your final stage resistor could be shot. And since electronics are often affected by heat, that could also explain why it works fine for 20 minutes and then misbehaves.
Ask a mechanic who is familiar with BMWs to try changing out your final stage resistor. It may cost you $150 or $200 bucks – or, as BMW refers to that amount, the ante. Good luck.