This may be a duplicate, but I couldn’t find that exact one in the many, many grace-related known bugs.
%% Reported on -user-fr: https://lists.gnu.org/archive/html/lilypond-user-fr/2020-05/msg00029.html
\version "2.20" %% I don’t think it has ever worked, though
{
\time 2/4
b'8 a' \grace a'16 g'4
%% These are beamed normally:
<< {b'8 a'} \\ {c'4} >> g'4
%% These _should_ be beamed:
<< {b'8 a'} \\ {c'4} >> \grace a'16 g'4
%% Moving the grace note in the next bar:
r4 << {b'8 a'} \\ {c'4} >> \grace a'16 g'2
}