Merge request diffs with "Merged" status not opening in WebIDE
<!--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=590051)
</details>
<!--IssueSummary end-->
<!---
Please read this!
Before opening a new issue, make sure to search for keywords in the issues
filtered by the "regression" or "type::bug" label:
- https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=regression
- https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=type::bug
and verify the issue you're about to submit isn't a duplicate.
--->
### Summary
When attempting to view a diff of a merge request with the "Merged" status in GitLab in the WebIDE the link that is opened in the Web IDE is incorrectly formatted and opens nothing. Manually entering the correct link for a merge request will open the diff properly, though.
Merge requests with other statuses such as "Open" and "Closed" have properly formatted links and open correctly.
### Steps to reproduce
1. Open a merge request that has the status of "Merged"
2. Open the diff for the merge request via `Code > Open in WebIDE`
3. The WebIDE will open but load nothing as the link attempts to open the branch (`https://gitlab.com/-/ide/project/[project path]/edit/[branch name]`) instead of the merge request (`https://gitlab.com/-/ide/project/[project path]/merge_requests/[merge request id]`)
### Example Project
We can see this behavior in any project on GitLab.com, including `gitlab-org`.
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/?sort=created_date&state=merged&first_page_size=100
### What is the current *bug* behavior?
Opening a "Merged" merge request via `Code > WebIDE` will not open a merge request and attempts to open the branch instead, leading to nothing opening at all.
### What is the expected *correct* behavior?
"Merged" merge requests should open in the WebIDE in the same way as merge requests with other statuses.
### Relevant logs and/or screenshots
Merge request on GitLab.com with a "Merged" status:
{width=900 height=460}
Link opens the WebIDE but goes nowhere:
{width=900 height=460}
Merge request on GitLab.com with an "Open" status:
{width=900 height=460}
Merge request opens properly in the WebIDE
{width=900 height=460}
### Output of checks
This bug happens on GitLab.com
<!-- and uncomment below if you have /label privileges -->
### Possible fixes
<!-- If you can, link to the line of code that might be responsible for the problem. -->
### Patch release information for backports
If the bug fix needs to be backported in a [patch release](https://handbook.gitlab.com/handbook/engineering/releases/patch-releases) to a version
under [the maintenance policy](https://docs.gitlab.com/policy/maintenance/), please follow the steps on the
[patch release runbook for GitLab engineers](https://gitlab.com/gitlab-org/release/docs/-/blob/master/general/patch/engineers.md).
Refer to the [internal "Release Information" dashboard](https://dashboards.gitlab.net/d/delivery-release_info/delivery3a-release-information?orgId=1)
for information about the next patch release, including the targeted versions, expected release date, and current status.
#### High-severity bug remediation
To remediate high-severity issues requiring an [internal release](https://handbook.gitlab.com/handbook/engineering/releases/internal-releases/) for single-tenant SaaS instances,
refer to the [internal release process for engineers](https://gitlab.com/gitlab-org/release/docs/-/blob/master/general/internal-releases/engineers.md?ref_type=heads).
<!-- If you don't have /label privileges, follow up with an issue comment of `@gitlab-bot label ~"type::bug"` -->
issue