See dandi/dandi-archive#2687 (comment)
When validating the metadata of a dandiset with a schema version that is older than the current schema version, instead of being constructed locally from the models (and crucially, supplied env vars) within dandischema, it is fetched from the generated dandi schema files.