New MR page: when a user previews the diff a non user-friendly error is displayed

Summary

Error is being displayed when previewing changes from the New MR page (before creating the MR)

Steps to reproduce

On gitlab.com (Next)

  1. Create new MR
  2. Click Changes tab

Example Project

Any project

What is the current bug behavior?

Error is displayed MergeRequest|Failed to load the page

Also scrolls to the top of the page, see: #387275 (closed)

What is the expected correct behavior?

No error displayed

Relevant logs and/or screenshots

Screenshot_2023-03-14_at_11.02.47

Results of GitLab environment info

gitlab.com Next

Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Edited by Jay McCure