why does my car idle rough in the morning for about 25sec on 2001 Toyota Solara

Rookie cbe0621eac06868b3efe0d8d1d3611e23c60d3114864ea2ec19a68cfbd3eebab
it all started when my check engine light came on. i took it to toyota and they told me its the air fuel ratio sensor. before replacing the sensor, i tried taking one of the battery leads of to reset the code. but after i put the battery lead back on. the car started idling rough like it was going to stall. other than that the car runs perfectly. i changed all the spark plugs,oil change, new air fuel ratio sensor, throttle body clean up snd engine coolant flush
(2) Answers
A very common thing on Toyota is that the Idle Air Control motor wears out. It will cause a rough idle, especially in the morning. Sometimes you can clean them but often they have to be replaced. Who did the Air/Fuel ratio sensor? It is absolutely critical to get just the right one. Toyota has factory updated this part so an after market one is risky.