[MWF] Add unit test for #24372