This car has more cheap plastic parts than any other vehicle I have ever owned. Coin holders, door handles, cup holders, window shades, trunk latches, and trim pieces have all broken from normal use.
The ABS control module failed at 80,000 miles, a $700+ part.
The MAS (mass air flow) meter failed at 82,000 miles, a $500+ part.
The windshield washer fluid reservoir cracked, per the dealer, a $245 dollar part.
The intake gaskets needed to be replaced at 78,000 miles for over $800.
The theromstat needed to be replaced a hundred miles after the intake gasket, $245.
The ambient tempurature sensor failed at 65,000 miles.
The dealer also says the valve cover gaskets, front main seal, real main, and power steering lines leak.
This car has not had a hard life. The maintenance schedule was followed. And yet I am afraid to drive it as it seems every week another plastic part breaks off or the service engine light comes on indicating another expensive repair is needed. This is by far the worst vehicle I have ever owned.
When it is running, it is a pleasure to drive. Solid, quite, fast. But if you can't afford about $500 a month for repairs don't bother.
The mechanical problems you described are ALL well known E39 5-series faults. However, once those are sorted, the car is a dream! Don't even bother fixing the cup holders (they were an after-thought for the N.A. market), just buy the plastic delete panel for $20 at the dealer.
Unfortunately, not really true that once things are fixed you're done with them for good. In fact, there are many areas of these cars that see continual failure of the same parts over and over as a result of poor design and/or materials.
Window actuators, radiators and all other plastic components in the cooling system, various sensors, ABS sensors, fuel senders, MID and cluster LEDs, etc., etc. I don't mind too much fixing things that break, but it gets tiresome replacing the same parts over again and in multiple cars across model years with parts that you can see have not been modified to correct the source of the problem.
I've had 3 of various years and they've all been the same. Talk to long-time owners and we'll all say the same thing - Great cars but be prepared to pay the price in continual problems and expense that comes with the territory.
Looks like you got ripped off by your dealer. Yhe repairs are common, the prices are not.