Linking to cells is broken for notebooks with unpublished changes

So this one’s a bit subtle:

Linking to a cell doesn’t work right for notebooks with unpublished changes, but it is working fine when a notebook is published. The reason seems to be that somehow the header is not included in the scroll position calculations.