schedule_patch_autotasks requires schedules_global_autotasks to run first. It seems we have somehow lost this dependency, causing schedule_patch_autotasks to fail. For example, here or here.