Running in the same problem here. The mdl_sessions table doesn't seem to get any cleaning at all.
I'm just a Moodle admin, not a dev, not a sys admin. I installed Moodle on my machine to try to figure out what was happening. The scheduled tasks runs normally, the sessions folder gets cleaned, but nothing changes in the mdl_sessions table.
So on a busy production site, we can reach millions of entries in mdl_sessions, mostly from userid=0. And I think it causes the task to eventually fail.