I had a similar problem with my outback. Cruise light on engine management light flashing and s drive stuck in “s”. The solution I found was 1) loosen filler cap - big rush of air into the tank. 2) reset trip computer and hey presto the lights go off.
think it might be related to fuel starvation with vacuum in the tank.
hope you find a solution