The issue is about BgMask: extract still background from video frames / mask frames against background , see Thread-extract-from-gif-with-BgMask-script.
The GIF file come from giphy.
I tested with the .scm script and working well with extract background and mask.
I have noticed that the differences are significantly positive when the background is static and the animation does not exceed the display area of the GIF file, see the output result:
.