According to this post, the syntax is:
ffmpeg -y -i test.gif -filter_complex "drawtext=text='Test':fontcolor=red:fontsize=24,split[s0][s1];[s0]palettegen=reserve_transparent=1[p];[s1][p]paletteuse" output.gif
My guess is that FFmpeg decodes the GIF into raw RGBA format and draws the red text on the RGBA image (in the RAM).
Applying split, palettegen and paletteuse, generates a new palette (ignoring the original palette), and convert the raw RGBA image to indexed image using the generated palette.
(In theory, there is more efficient way doing it when the red color is part of the original palette, but I don't thing FFmpeg supports that kind of optimization).
Testing:
- Download the PNG image from my former post (image in RGBA format).
- Convert the PNG image to GIF image (with transparency):
ffmpeg -y -i 6qepl.png -filter_complex "split[s0][s1];[s0]palettegen=reserve_transparent=1[p];[s1][p]paletteuse" test.gif
- Draw red text while preserving transparency:
ffmpeg -y -i test.gif -filter_complex "drawtext=text='Test':fontcolor=red:fontsize=120,split[s0][s1];[s0]palettegen=reserve_transparent=1[p];[s1][p]paletteuse" output.gif
Output (resized):

(The red dots around the transparent part are the result of the newly generated palette).