I'm pretty certain that this is NOT caused by accidentally holding the unlock button down for a longish time. It's happened to me three or four times, and twice when it was pouring with rain!
I was pretty certain that the car was still locked on those occasions, but I was more interested in getting them shut than doing thorough diagnostics.
However, the last time it happened it was DEFINITELY still locked and the windows, as on previous occasions,
were only half-way down.
I tried the fob cover on backwards and as normal (as suggested by jadnashuanh), but it didn't stop the problem occurring again.
I asked the BMW people to disable the window wind-down facility and they said they could do so by reprogramming the car, but when they tried it wasn't disabled.

Noteworthy cars I've owned previously: Lancia Aprilia ... 20kWh i3 Rex.