This has been driving me nuts, zero understanding of why it happens.
Sorry, I can’t lend any help other than saying that I used your first code snippet but found increasing the window.height - value (I used 800) pushed the first load view up the page.