E34 525i 2.5 24v DOHC.

The car starts and runs perfect most of the time.
Every now and then after it has started in the morning it will run fine and then suddenly become sluggish.
Pressing and holding the throttle flat it revs to +-3000 and then drops back down, then up again and back down, it will not rev up.
Also driving it like that is impossible, pulling off is nearly impossible.
When I unplug the Air sensor it runs better but heavy on fuel, sometimes that doesn't even help.
Anything to try or test ???