I know someone with much more smarts will jump in, but meanwhile...
In Epub 2.0, if the Index is in a different file from the "book text" (and it almost always is), the link must contain the full path to that specific file name. Such as:
<a href="
../Text/index.xhtml#a1">This history</a> was written...
Only if the link and the target text are in the same file can you get away with just inserting the naked id ("a1")
One of the reasons I love Pagina Epub Checker is that it identifies "undefined" links for me.
https://www.pagina.gmbh/produkte/epub-checker/
The site also has descriptions in English, and versions for Windows, Mac, Linux.