Had this happen on a '95 525iT. Turned out to be a huge vac leak under the intake manifold. The plastic connector that connects the vac line from the ICV to the intake had snapped it's retaining clip off and it's come out of the manifold. $6 later at the dealer and the problem was fixed.
The car was also throwing a MAF code when it was doing this. And the MAF was never the problem (found that out after buying a new MAF after having no luck with a used one).
What code/codes is the car displaying on a stomp test?
Cosmos Black/Black 1995 540iA M-Sport
BMW Individual Exclusive Edition, 1 of 65 total, 9/25/95 Build