I think what you are referring to is related to https://github.com/jgm/pandoc/issues/1607 and https://github.com/jgm/pandoc/issues/1692, please see revelant discussions. Basically, docx is a mess.