You can do something similar with ffmpeg’s palettegen/paletteuse or imagemagick’s fuzz option. Generally speaking, fuzz/IM does well for recompressing GIFs, especially high-noise or static background. If you still have the source video, nothing can beat ffmpeg though.
(Those options usually require a bit of tweaking though. I can’t compare these at work, might give it a go later.)
This is absolutely not similar to any ffmpeg/IM's options. This doesn't change the palette, and doesn't rely on static backgrounds.
Instead, it integrates very deeply into LZW compression to make dictionary matching visually approximate in a way that maximizes compression. The only other implementation of this that I'm aware of is in Photoshop.
(Those options usually require a bit of tweaking though. I can’t compare these at work, might give it a go later.)