The db.runCommandWithMetadata shell helper was used to send messages to the server in the OP_COMMAND wire protocol message format, which has been deprecated since 3.6 (and was only used in 3.2). Currently, it takes both the "metadata" and "command body" bsonobjs that would be used to build a OP_COMMAND, and builds a single bsonobj out of both, which it then packs into an OP_MSG to send to the server as the message's body. This can generate BFs when the fuzzer generates metadata and command body bsonobjs that share a field name, as a bson with duplicate keys will then be created after these are concatenated and packed into an OP_MSG. (In invariant here will be hit when the OP_MSG is serialized in preparation of the shell sending it to the server)
Because this helper is meant to test a protocol that has been out-of-use since 3.6, we should just remove it entirely from the shell and the fuzzer to prevent further BFs/required maintenance. This should also let us clean up a fair amount of supporting code in the shell for this function.