The guessMimeType method in the MimeAnalyzer class uses the doGuessMimeType method by default to detect the mime type of files (https://github.com/wikimedia/mediawiki/blob/master/includes/libs/mime/MimeAnalyzer.php#L520). This method is MediaWiki's custom mime detection code. Only if this method fails to detect the mime type, is an external API used ("detectMimeType"). Unfortunately, MediaWiki's custom mime detection code might contain bugs which could be prevented if the external API is used by default, for example T291750. The current behavior is inconsistent with the documentation at https://www.mediawiki.org/wiki/Manual:MIME_type_detection ("If installed, MediaWiki uses PHP's FileInfo module, or the older MimeMagic module.").
The code should probably be changed to call detectMimeType first instead of doGuessMimeType.