Not certain I fully understand the problem from your post.
When you refer to 'lever', does the machine have an electrical-type on-off switch or a mechanical lever you can feel the engagement?
If a switch type and problem is intermittent, suspect a bad switch or solenoid or whatever engages the PTO. May have from the description also a bad seat safety aka Operator Presence switch. Most likely a switch trying to fail or being 'sticky'.
Investigate seat switch. May need wiring schematic to determine how all the PTO and safety switches interact.
Might start by using aerosol electronic tuner cleaner / lube (not WD-40) and dousing switch(es) liberally, check also connector pins / clips. Clean connector and pins and use tiny smear of clear-white silicon plumber's stem grease (not pipe thread sealant) to prevent future corrosion and enable easy disconnection and make slightly water-resistant.
Please post back your continuing thoughts, observations, and experiences so we may all learn.