I have a roper RTW4340SQ0 top loading washer that will stop on the spin cycle. If I open the lid and shut it again it will start spinning again. I have opened the lid while it was spinning and shut it again and it stops spinning. If I open the lid and shut it again it will start spinning. So then I found that it will stop every other time I open the lid. I doesn’t seem like a mechanical issue but I am not sure it the agitator alternates direction when the lid is opened
That is odd, but first check and maybe replace the lid switch. Sometimes when they are broken they operate the way you describe your machine is doing.