I can't be sure what is happening without further inverstigation, but if all you need are anchors, there is the anchor plgin. It's old, but it still works:
https://www.dokuwiki.org/plugin:anchor.
Or you can create a link to any header in the current page:
[[#anchor|text]]
where anchor is a lower case translation of the header with underscores replacing spaces.