2017 Nissan Rogue rolled backwards in Drive

Today after I started up my rouge and put it into drive it started rolling backwards , scared me. So I turned it off and put it into drive finally wheat forward.what could cause this, I am worried.

2 year old car under warranty. Take it to your dealer and tell them what you told us. They will fix it for free… that’s what a warranty does.