Restore scroll position on iPhone Safari

I have an app which allows a user to navigate forward and then view ‘side pages’ and navigate back. On navigating back, I would like to restore the scroll position.

My code works on Chrome on desktop, and works in the developer tools iPhone preview but fails on iPhone to restore the position.

Any help is appreciated, thanks.