+1 on the speed sensor, pull it out first and wipe it off. Sometimes it gets enough **** on it to stop reading correctly, otherwise replace it as it's an easy fix.
Yeah check the speed sensor. If I remember correctly they are slightly magnetic and small metal gunk will stick to it. If have to replace, I think mine was about $35 a couple years ago
I agree with the speed sensor as your symptoms were identical with mine. I believe I "cooked" it last week when riding across Western Kansas / Eastern Colorado in 107 degree heat - cruise on and legs up on the mustache bars. The next day, everything would work in the cool mountain air for about 30 miles. Cleaning it is a good start but did not help. It was an easy (20 minute) parking lot repair.