2005 Grand Prix with infrequent chugging

On ocassions car will be sluggish on acceleration with chugging. I can clear it up by turning off car and restarting. Car dealer code not find any error codes. What could be causing this issue and why does just restarting clear the issue?