fix underflow in vec swap_remove

fixes #16200