I think the level units in the oil pan itself though Justin meaning you have to drop the oil to check it.
I suppose that you could give it a clean etc and put the old oil back in purely as a means to check if everythings ok as opposed to putting new oil in then potentially having to drop that if its still bonging
The oil levelling sensor is part number 9 here in case you need the part number: RealOEM.com BMW E39 M5 Oil pan bottom part, oil level indicator and as you say, is not particularly cheap. It is a straight screw in & out job when the oil is drained from the car so it would be possible to remove, clean and refit the old sensor, refil with the old oil and see if it fixes it, but for the price of a tank of fuel I would be inclined to replace the damn thing and it's done with. Oh wait, I need to because mine has gone bad too.:grrrr:
For your information, it actually measures oil temperature and works out the oil level from that. It is one reason you should always check the engine oil level with the dipstick instead of relying on the car to tell you it is in need of the lovely stuff.
Can't see how it works it out!
Obviously does to some degree of accuracy.
Just gave faulty low oil level readings at first but now temp to max as well, and finally code.
Sod it, not cheap, but is compared to the car it is.