Regression test for #17740

Closes #17740.