Why does check engine light come on when RPM,s over 5000? on 2006 BMW X3

Everytime I go over 5000 rpm's when passing or going up hill the check engine light comes on, the car also starts to jitter and feels like it's going to stall. Then I have to stop and shut the car off. After that, I turn the car on again and the stalling goes away and the car drives OK but the c/e light remains on. The mech resets it, if I drive it again (over 5000rpms)it starts to stall. He put new coils in, drove it and it did the same. he installed my original coils back in. the diagnostic does not give him no engine codes so right now he said not to drive it to that point. Have you heard about this before?

Asked by for the 2006 BMW X3
I've got the same exact problem with my 04 civic. At first it goes up to 5000 rmp and CEL comes on then after a while it can only go up to 3000 rpm. Your post was from a few months ago, would appreciate some feedback if you got the problem fixed. Thanks.