Keep Cropped Images Centered in Photoshop by Disabling Overscroll
Photoshop’s Overscroll option lets you pan around even when an image fits the screen. But with some crop workflows, it causes the canvas to jump off-center. Disabling Overscroll restores centered behavior after cropping or undoing a crop.

Step-by-step instructions
1
Understand when the issue appears
Cropping with the Rectangular Marquee Tool → Image → Crop can throw the image to the upper-left.
Using the Crop Tool in Classic Mode can do the same.
Undoing a crop can also shift the image off-center.
2
Turn off Overscroll
On Windows: Edit → Preferences → Tools. On Mac: Photoshop → Preferences → Tools.
Uncheck Overscroll.
Click OK.
3
Test the fix
Crop using your preferred method (Crop Tool or marquee selection + Image → Crop).
The cropped or restored image should remain centered on screen.