See this Reddit post for details and example code: https://www.reddit.com/r/jenkinsci/comments/l0w4ju/job_dsl_plugin_reload_button_works_fine_on/
Basically, reloading manually via the "configuration-as-code" page works fine, but reloading using "ConfigurationAsCode.get().configure()" within a Groovy script fails when folders and/or jobs are defined within the yaml file. The Groovy reload command works fine when there are NOT jobs or folders defined within yaml, so I think the script permissions and syntax are correct.