I was close to this approach almost 24 hours ago, but I defined the new variable a little too far down and continued to use sy in the should_update_screen_top check.
Overall, I now understand why my old approach almost worked: I only needed to offset for the title in the first pane because subsequent increments by height included space for the title of the next pane.
But it took me the longest time to get to this insight. And I didn't quite understand it even though I was syntactically close to the answer almost 24 hours ago.
This is another lesson not to let my brain be contaminated by solutions I don't understand. Even though I was careful to document what I didn't understand, a bad answer that works 90% of the time makes the good answer harder to find, because the bug becomes harder to reproduce. In this case, the issue only became clear when I created a test directory from scratch with tiny notes of identical heights.
2UGGJ7JNP6FISC2TGNDP2ZTLVSFS7PUVXRLVENDNSERG6X5G5UNQC
if sy < Display_settings.y then
pane.screen_top1, y_offset = schema1_of_y(pane, Display_settings.y - sy)
if body_sy < Display_settings.y then
pane.screen_top1, y_offset = schema1_of_y(pane, Display_settings.y - body_sy)