This will be just a clumsy answer because I do not use FFmpeg. But the problem I am seeing is not that you have a board palette, but that the program is adjusting the colors from a palette to a color that is not included in that palette.
Some options to explore:
Take a color picker and measure one of the two colors the program used on your gif and modify the solid color to match it.
See if your program can prepare a specific palette for you, normally this is choosing an optimized palette or an adaptive one.
See if you can turn off any dithering.
There is a chance your original image already has those artifacts, one example I can think of is that you are using an MP4 file with too much compression and it actually shows some blocks in the blue zone. Then the program is choosing another color for them.
If options 2 and 3 are not available try using another program.
But let me answer the border original question.
How to create a color palette to avoid dithering in GIF?
You have a total pallete of 256 colors, but you can not use them all.
You need to limit the colors so some of the colors can be used in aliasing things.
On the case, you posted you need a blue, a white and let's say that we save 4-6 more colors for aliasing between blue and white. We can use just 8 colors.
But when we add a third color two things can happen.
a. The new color, green, only has borders with the blue. We then need 8 colors for the aliasing.
b. The new color, green, has borders also with the white. In this case, we need an additional 16 colors for our palette for the two different aliasings.
So I would limit the palette of let's say 16 colors so you have 16 additional colors per color for transition with the other colors. The more complex the scene the less exact this aliasing will be, but you have a clear limit for you to work.
This is of course on a flat design.