Cron jobs would be better suited to a Cron Job service or if you want to roll your own scheduler, a Background Worker. It looks like you’re trying to run it alongside a Web Service.
If you could share some more details that may help us troubleshoot it with you, e.g. any logs/errors/output, service ID, reproduction steps, etc. If you don’t want to share these details on the community forum, please feel free to raise a ticket with support@render.com