After removing a registered middlware from the slice, we need to update the index lookup map with the updated index for each middleware.
After removing a registered middlware from the slice, we need to update the index lookup map with the updated index for each middleware.