Startup recovery for unfinished index builds first drops each index from the durable catalog before restarting the index build.
The recovery procedure then initializes the collection's in-memory state with Collection::init(). This also initializes the IndexCatalog, which invariants that all indexes in the durable catalog are ready.
If there is more than one unfinished index build, separate calls will be made to initialize the IndexCatalog for each build. The first call will fail on this invariant, because the second index has not been dropped yet.
Fixing this is tricky, because both the Collection and IndexCatalog can only be initialized once, and index builds need to be started in separate threads. Additionally, dropping and recreating indexes need to be part of the same storage transaction.