Fix test gap on Query.vulnerability

Summary

!116643 (merged) introduced a bug where Query.vulnerability would always return nil.

See: !116643 (comment 1377310058)

The pipeline passed on this MR, which signals that we have a test gap. Investigate why the tests did not fail and add tests to catch issues like this in the future.

Relevant links

Non-functional requirements

  • Documentation:
  • Feature flag:
  • Performance:
  • Testing:

Implementation plan

Verification steps