Fix bug found when running individual tests against #17217 after merging