MX5 motor jerks and engine warning light goes on and off

Hello fans, just bought a beautiful yellow MX-5 NA (US model) year 92 with 73000 miles, which saw the last 18 years German stares almost only in the summer. Engine ran quite normal during the test drive, but showed during the idle time the problem that the speed fluctuated between 1500 and 300 rpm and the yellow engine warning light flickered (Foren are known to me, I have not made the idle setting with overrun motor control yet). Now 200km later. At the same time, there is no more power (motor ruptures) and despite the interlocked gear, the speed in the tachometer drops for a short time (strange??). This extremely unpleasant motor turbulence occurs at every speed (high I have not tested too much now out of caution) and under partial load and full load. Even in sliding mode, the yellow warning light flickers and I mean a red warning light. Sometimes this error also disappears completely and a connection between warm or cold engine I could not detect. Mechanical engine problems I exclude. Must be electrical or a sensor, because the engine management light comes with the ruching in the same clock. By the way, the car had rusty, muddy cooling water, which was changed and since then the ruching seems to be there. Thanks for your advice, or what to test in which order. I found no comparable case in the forums. Thank you!!!