This is probably related to the "Release-critical accidentals spacing
bug"
(http://lists.gnu.org/archive/html/bug-lilypond/2006-03/msg00039.html),
but here's a telling example:
\version "2.7.38"
\layout {ragged-right = ##t}
{
<fis' ais' cis''>2~ <fis' ais' cis''>~ | <fis' ais' cis''>~ <fis' ais'
cis'' gis'>
}
It seems that when a chord with accidentals is tied across the barline,
or when a new note is added to the chord, the spacing accounts for the
old accidentals as if they were repeated. Notice that in the example
above, the second chord doesn't have any extra space (it's mid-measure
and doesn't add any new notes), while the third and fourth chords have
just enough extra space to accomodate all the accidentals, whether or
not visible.
Marcus