Thanks for the reply!
The problem is that all tasks (around 20,000) were stucked waiting for those problematic tasks to run.
And I purged caches, looked for error in moodledata/temp/backup/ ... no problem found nowhere.
The only way I could imagine to go on was excluding or postpone the stucked entries.
So, at least for now I decided to postpone and once that was done, tasks finally started to run.
Now I will have to decide what to do with the 26 blocked entries. It is curious: they are all related to 2 courses by the same teacher. It seems that there is a problem with some files that he tried repeatedly to put into
activities.
The fact is that these entries seem impossible to perform. Every time they run (by comandline), results in a "PHP Fatal error: Allowed memory size of 4294967296 bytes exhausted". But I have already tried to increase the memory limit even to 7GB per config.php ($CFG->extramemorylimit = '7168;) and it seems that the query only wastes more time, killing when the memory runs out.