Hi,
I did some testing on this and it seems that this only happens when you swap out an egg with a gift Pokemon, as is the case with the Epoch Drowzee in Stonefall Cave. It doesn't appear to occur on my end if you are just catching wild Pokemon through normal means (i.e. with a Pokeball).
As this is a third party script that I was using, I've reached out to the developer to see if they have a solution, but in the meantime, I would recommend until I determine a fix for this to not swap out eggs from your party with gift Pokemon (you can still do so if you catch the Pokemon normally though). I will update the main post with a "known bugs" in the meantime.