createIndexes on mongos is currently broadcast to all shards rather than only targeting shards which own data for the collection, since listIndexes expects the primary shard to have all the indexes for the collection (and the primary shard might not own any chunks for the collection at some particular time) (
However, this means the collection is implicitly created on shards which don't own chunks for the collection AND don't have an entry for the collection in their storage engine (e.g., any shard that has never owned chunks for the collection). The collection is implicitly created on these shards without the collection options, including the collection's UUID.
To prevent this,
1) mongods running as --shardsvr should fail createIndexes with NamespaceNotFound rather than implicitly create the collection with the wrong options
2) for createIndexes on a sharded collection, mongos should ignore NamespaceNotFound errors from shards
3) for createIndexes on an unsharded collection, mongos should check if the collection exists on the primary shard, and explicitly create it if not before sending createIndexes to the primary shard