When UnknownJson decoding fails (malformed file), the schemaDeclarationRef was not reset to undefined. On a file-watcher reload, a stale $schema value from a previous successful load would survive and get injected into the next updateSettings call. Add the missing else branch to reset the ref, consistent with the file-not-found case.