What leads you to believe that this is an ECU problem? When you turn the car off, you do not cut power to the ECU which means that there is no reset occurring. Honestly, you have a car that is misbehaving significantly and it's under warranty. Bring it to the dealership and have them look at it. Sounds like you don't have problems reproducing it so they should be able to see it.