The 'Fit on Screen' feature works fine for zoomed-in and out documents, but it doesn't work properly when the document has been moved. For some reason, the document won't fit the window, although the scrollbars move to the center of the window as if the document has been centered (fit). The document requires an additional click to be centered:

In Illustrator everything works fine though.
macOS v12.7.1
Photoshop v25.2.0