Welcome to the forum.
When the engine management light comes, it means there may be a serious engine/transmission problem. The ECU then goes into damage control mode and runs the car on what they call "Limp Home Mode" (LHM) which only allows the transmission to operate in 3rd when Drive is selected. Also allows manual selection of gears and reverse. So, the result is a very sluggish engine. When/if the light goes out, things return to normal.
You can find out exactly why this is happening by doing a fault code test - very simple and all you need is a paperclip. At a guess I'd say your problem will be a faulty solenoid in the trans - code 82 or similar. Anyway, here is the link on how to do the test. Checking error codes VR/VS (Revised)
Report back with what you find.
Good Luck.
"If anyone disagrees with anything I say, I am quite prepared not only to retract it, but also to deny under oath that I ever said it." --T. Lehrer
"The secret of success is sincerity. Once you can fake that you've got it made." -- Jean Giraudoux