Hi rccd,
Thank you for the plugin. Reading converter.py, I think one book layout will confuse it: the caller is chosen by document order (lines 307 to 311, the earlier of the two linked paragraphs becomes the caller). When a notes file sits between two chapters, the note for the later chapter comes before its reference, so that note would be taken as the caller and the chapter paragraph as the note.
The attached test book has that shape: chapter 1, a notes file with notes 1 and 2, then chapter 2, with every note linking back to its reference. Converted to DOCX by stock calibre, the notes section sits between the two chapters and the second note comes before its reference. I have not run your plugin on it, so this comes from reading the code.
A heuristic that does not depend on order: the reference is usually a short marker inside running text, while the note's own link opens its paragraph, which holds the note text. Both can be short numbers, so it is not a complete test. My plugin has to make the same decision for EPUB; its rules are in find_pairs() in
https://github.com/paskal/calibre-po...n/footnotes.py, in case they are useful.