In the project, there are two or more Document Definitions. Does it matter in which order they're listed?
The Document Definitions are matched against the documents in the order in which they are listed in the Document Definitions dialog box.
You can change the order of matching by selecting the Document Definition and using the Move Up/Move Down buttons.
Please also note the Use first acceptable FlexiLayout option as it also changes the behavior of the matching. More details on this can be found here: What is internal process of multiple semi-structured (based on FlexiLayout) Document Definitions' matching?