The error message indicates an error with index
but your schema defines index
They do not match. I do not know Mongoose but my guess is that the indexes are not update in the database when your code is updated. Probably because the collection already exist. I think that you previously had a unique index of a field named index. Now that this field is not part of your schema, its value is always null.
To confirm what I suspect go into mongosh and run getIndexes() on your collection.