Experimentally GIMP doesn't take the layer visibility in consideration in the Playback filter or when exporting to GIF (so at least these two are consistent). This could be a bug but this feature has been around for a while (already the behavior in Gimp 2.8) so it could be considered normal.
This means that if you don't want to see layers in the animation you have to remove them (possibly after Image>Duplicate)
This means that if you don't want to see layers in the animation you have to remove them (possibly after Image>Duplicate)