Thank you for looking again at it Eli,
in the recipe, I am printing the buffer-name and the window-start
together (where the buffer-name gets evaluated before window-start),
and it says that the buffer-name is 'example'. So I expected
(window-start) to return the window-start from the window displaying
the example buffer.
I already wanted to write you that this must be the case, but I
thought let me first try to print the buffer of the selected-window.
In that case, indeed, it shows that the selected-window is that of the
warning buffer.
Finally, I understand now that the current-buffer is not per se the same
as the buffer displayed in the selected window. I understand it now, but
until now that was not obvious to me.
Thanks again Eli, for clearing things up!