What it sounds like is happening is that it’s running an excessively long cycle and then it’s locking out, likely due to exceeding a limit. Switching it off then causes whatever it is causing it to lock out to reset and it comes on and runs again.
Maybe someone who knows better than me can give you better direction, but that’s what it sounds like is happening.