whirlpool top load washer stops at rinse cycle, can open and then shut lid and then starts
I'd agree with Ajeh. Check the Lid Switch connections, including the ground right near the switch. I'd throw in a new Lid Switch and see if the problem continues or disappears. They're usually cheap and you may be able to shift the drum around enough to not take anything apart.

The only other culprit, I'm familiar with, would be the Control Knob...it directs everything. In some cases those can be very pricey, so you'll have to decide if it's money better spent on a single expensive part or a whole new washer.