For anchors to work across longer topics you would need to use the full post address with the header appended to compensate for the target post not being loaded on the screen.
If the anchor was <a name="anchor"></a> in the OP of this topic, using this link would work even in post eg 456
https://meta.discourse.org/t/anchors-not-working-across-posts-within-topic/240512/1#anchor
Does that help?