You are running out of governance. A scheduled script has 10,000 governance units available. Each call to scheduledScriptTask.submit() will use 20 governance units, meaning you can call that at most 500 times in a scheduled script before the script halts, so what you are saying makes perfect sense. You should be seeing a limit exceeded error getting logged for your script.
There’s only two ways to handle this: check your remaining usage and re-schedule the script you are in to handle the remaining results when you get close to 0. You’ll need to have a way to pick up where you left off so you don’t keep repeating the same 500. Probably the more preferred way would be to convert this to a Map/Reduce script as it can handle large batches of results without concern for running out of governance.