Add guards to other pane index removals (#2496)

These should be impossible for users to reach, but why leave it to
chance?

Release Notes:

* N/A
06a89d9104Mikayla Maki committed on 5/19/2023, 10:21:00 PM· committed by GitHubparents7d1833bc193b0b
1 file changedLine totals unavailable