Dear Harm, I tried to use your file distributed-note-heads-01.ly, attached to https://lists.gnu.org/archive/html/lilypond-user/2019-03/msg00062.html and I found out that it does not behave well with layout-set-staff-size (see attached example, which I tested with 2.20.0).
I wouldn't be surprised if this turned out to be a bug in layout-set-staff-size, instead of your code (see, e.g., https://lists.gnu.org/archive/html/bug-lilypond/2020-03/msg00021.html which, by the way, hasn't been added to the tracker yet). Best wishes. Davide
distributed-note-heads-01-bug.ly
Description: Binary data