This should work fine if you create those links like this:
<a href="[~[*id*]~]#anchorName" title="anchorName">Go to anchorName</a>
...
<a name="#anchorName"></a>
If you try to create them without the URL generated by [~[*id*]~], i.e. href="#anchorName", that is going to always go back to the root of the site.
Mmm... are you sure?
I've no problem at all setting anchors like
<a href="#top" title="Go to the top">Go to the top</a>
...
<a name="#top"></a>
@arphaus
Perhaps you've set the base-url in your template?