In log/log.c__wt_log_scan and btree/bt_handle.c:__wt_btree_tree_open on an error, we try to give the user a helpful message. Those messages use wt_errx. Both files only print those messages when an error has occurred, so ret is known to be non-zero and both have already called wt_err with the return value and printed an initial message.
This can lead to some confusion in reading MongoDB logs and MongoDB does have different code paths based on whether or not the error value in the error handler is zero or non-zero. When reading the logs we see one message with an error number and then three messages with an error of 0. That can lead someone to believe the error was lost, overwritten or something.
Both wt_errx and wt_err call the exact same lower function, just with 0 or the given error value respectively. Both WiredTiger functions noted should use wt_err instead and continue to provide same ret to those messages so that the error handling callback and the log messages that result continue to show the same error.