I've owned 2, a 2009 S and 2011 SL 1.8L. I can think of 2 possible situations I've had that sound similar. Sometimes, I've even been able to reproduce situation #1
1) Car sits long enough to cool down completely. Get in, start it, put it into gear quickly, move it in the driveway, shut it off. Sometimes, it would struggle to restart right away, or it would the next time I got into the car after it cooled down.
I have never had this problem if I let the car run no less than 90 seconds before putting it into gear, and during cold ambient, this car needs more time than that (when the cold engine light shuts off).
2) One other non-electrical situation I ran into on my 2009 was when my fuel pump died around 123,000 miles. That throws a code, so it wasn't that. When I replaced it with a scrap fuel pump w/housing, the Fuel Pressure Regulator caused the car to frequently take 10 seconds of cranking and variable fuel pedal manipulation to fire up. I simply swapped my old one with the scrap one and the problem stopped.
So, I'd think about #1
. Make sure you let it warm up a little. See if it happens again. If it does, #2
could be a possibility. The FPR's located inside the fuel tank on the fuel pump assembly, but it's not the hardest DIY repair by any means.