Add regression test for #18566