My script takes 35 student names from the Sheet \'Studenti\'. Then finds the proper folder with their name (i.e. \'Smith Peter\'), removes old pdf document with old grades h
In the SO post, the user is trying to delete the converted file and got the same error as you are.
I suspect you're hitting a rate limit. If you are doing more than 20 write operations (create, update, delete) in rapid succession, you need to throttle the requests to approximately one every 1.5 seconds.
Suspected reason is the user hits rate limit. Since you are also updating a data, there is also a possibility that this is the reason why it is working on the first few execution and reached the limit after.
And that is the only allotted maximum throughput you can achieve in Drive.