Test case for repeated deletion bug in issue #18508