makeWrapPlansPlugin throws error when adding dependency on a context value
<!-- Before opening an issue: if you use `npm` try running `yarn` instead; if
      you run `yarn`, please try running `npx yarn-deduplicate && yarn`. -->

<!-- You can also chat with us on Discord: http://discord.gg/graphile -->

### Summary

I'm trying to use `makeWrapPlansPlugin` to try to check `context()` values before allowing some plans to execute. I'm trying to do this in a way that may or may not be correct, by adding a lambda step checking the context value as a dependency of the step/plan being wrapped:

```typescript
const WrapPlansPlugin = makeWrapPlansPlugin(
  (context) => {
    return // some filtering logic here
  },
  (_scope) => (plan, $field, _fieldArgs, _fieldInfo) => {
    const $ctxValue = context().get("valueFromContext");
    const $checkContextStep = lambda($ctxValue, (valueFromContext) => {
      if (!someCustomLogic(valueFromContext)) {
        throw new Error('this resolver should fail');
      }
      return null;
    });
    // @ts-ignore
    $field.addDependency($checkContextStep);
    const $result = plan();
    return $result;
  },
);
```

Confusingly, this sometimes works, but sometimes throws this error:

```
Error occurred during pushDown; whilst processing Lambda{2}[25] in dependents-first mode an error occurred: Error: GrafastInternalError<64c07427-4fe2-43c4-9858-272d33bee0b8>: invalid layer plan heirarchy
```

I have a feeling I'm misusing or misunderstanding the dependency/plan/step system! And am curious if this _should_ work, or if I should be using some other strategy altogether to run some code which executes _before_ every field-scoped resolver automatically produced by postgraphile v5.

(I'm working with the team at the New York Times, in case that helps from a GitHub triage pov!)