If the database names on the primary and secondary don't match, CheckReplDBHash immediately appends the error message to an output buffer. However this is not an actual error when the only collection(s) in the db(s) are system collections.
CheckReplDBHash checks for system collection expclicitly and sets a flag "success" to true to prevent printing the errors. But when there is at least one other legitimate error, the flag is set to false and all the errors are printed.
A possible fix would be to have the error message for the database name checks stored in a separate buffer and only use it when the mismatch is not caused by a system collection.