And one addition:
I did try the options you then gave me. (context \score \override
SpacingSpanner.strict-note-spacing = ##t and also \override
Score.SpacingSpanner.strict-grace-spacing = ##t)
The relationship between those two settings is not at all obvious from the
documentation:
https://lilypond.org/doc/v2.22/Documentation/internals/spacing_002dspanner_002dinterface
https://lilypond.org/doc/v2.22/Documentation/notation/changing-horizontal-spacing.html#strict-note-spacing
https://lilypond.org/doc/v2.22/Documentation/notation/special-rhythmic-concerns#grace-notes
But in fact, if I read the source correctly,
strict-grace-spacing = ##t
is strictly weaker[1] than
strict-note-spacing = ##t.
So, in your use case: You can forget about strict-note-spacing, since the
behaviour that interests you is controlled by strict-grace-spacing, and
strict-note-spacing does the same thing *and more*.
Lukas
[1] For future reference: The two booleans are translated in
lily/spacing-options.cc into
float_nonmusical_columns_ for strict-note-spacing
float_grace_columns_ for strict-grace-spacing
which both are used
1) in lily/spacing-determine-loose-columns.cc: treat grace columns as loose if
_either_ of the two properties is true,
2) in lily/spacing-spanner.cc: handle actual non-musical columns; here, only
float_nonmusical_columns_ is used.