I'm guessing that it's an issue with the markup command \beam. Looking at the definition in define-markup-commands.scm, it seems that 'blot-diameter isn't taken into account in the calculation of width and thickness. (Is this intentional or a defect?) The following fixes the problem with the beam's length and thickness, and will work when you change the staff size:
\version "2.14.2"
#(set-global-staff-size 24)
#(define (test-stencil grob)
(let* ((beam (ly:beam::print grob))
(b-d (ly:output-def-lookup (ly:grob-layout grob) 'blot-diameter))
(beam-extent-x (ly:stencil-extent beam X))
(beam-length-x (interval-length beam-extent-x))
(single-beam-thickness (ly:grob-property grob 'beam-thickness))
(beam-positions (ly:grob-property grob 'positions))
(mrkp (markup #:beam (- beam-length-x b-d)
0 ;; level Beams only!
(- single-beam-thickness b-d)))
(new-Beam (ly:stencil-in-color
(ly:stencil-translate-axis
(ly:stencil-translate-axis
(grob-interpret-markup grob mrkp)
-0.024 X) ;; why??
(car beam-positions)
Y)
1 0 0)))
new-Beam))
\relative c' {
\override Beam #'layer = #-4
\once \override Beam #'stencil = #test-stencil
e'8 [e]
\once \override Beam #'color = #red
e [e]
\override Beam #'color = #green
f8 [f]
}
I can't figure this one out...