MediaWiki contains custom code to detect the mime types of files in the MimeAnalyzer class, in the "doGuessMimeType" method. In particular, it has the "detectZipType" method to detect different zip file types, such as OpenDocument and OpenXML. To detect an OpenXML file, this method looks for a zip entry which matches the /^\[Content_Types\].xml/ regex.
LibreOffice stores this entry last in the zip file, whereas Microsoft Word stores the entry first in the zip file.
This means that the header check at https://github.com/wikimedia/mediawiki/blob/master/includes/libs/mime/MimeAnalyzer.php#L842 does not detect the LibreOffice docx file as OpenXML. The method fails to detect the type of the zip file and MediaWiki refuses this file.