Line linking in diffs does not show the targetted line
<!--IssueSummary start-->
<details>
<summary>
Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards.
</summary>
- [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=496702)
</details>
<!--IssueSummary end-->
**Summary**
`spec/features/merge_request/user_sees_diff_spec.rb:50` started failing frequently and had to be quarantined due to this bug
Linking directly to a diff line does not sure the desired line.
Bug details https://gitlab.com/gitlab-org/gitlab/-/merge_requests/166798#note_2128156493
Test failure issue: https://gitlab.com/gitlab-org/gitlab/-/issues/454628
**Reproduction Steps**
via rspec:
`rspec spec/features/merge_request/user_sees_diff_spec.rb:50`
or
1. Go to https://gitlab.com/gitlab-org/gitlab/-/merge_requests/165761#note_2128585885
2. Click on the file path in the diff file header
3. Page switches to the Changes tab but doesn't scroll to the target file
4. If you click on a closest file to that in the file browser the scroll will completely break

issue