This:
CodecRegistryHelper.fromRegistries(CodecRegistryHelper.fromCodec(new UuidCodec(UuidRepresentation.STANDARD)),
MongoClient.getDefaultCodecRegistry()));
does not work as expected. The problem is that when the second registry creates, say, a DocumentCodec, it does so with no knowledge of the outer registry. When the Document Codec subsequently gets a UUIDCodec, it gets it from the second registry rather than the outer registry.