I think this is a serious bug that hasn't been fixed yet. In fact, it is not just raid on a ziggurat, any instant science/culture income will overwritten previous overflow, as long as you choose the next technology or civic to study. It often causes very serious loss of science/culture, especially in the late game, when your income is high.
For example, assume your science per turn was 100, if you just finished a tech which was only 20 science left, you got 80 as overflow. Then in your turn, if you get instant science from any other source, like: looting mines, trigger eureka, activating great scientist..., then the overflow science will be overwritten by this instant income, which means the previous 80 overflow were lost. It's the same with culture, too.
This effect has spawned another interesting problem. Many scientists, such as Darwin, Galilei and Janaki Ammal, often don't provide enough science points that they should have, that is because their science points are given separately. For example, Galileo Galilei gave 250 science points per mountain tile, if there were 4 mountains around, then he in fact gave 250,250,250,250 one by another, rather than just 1000. Assume you have set 3 techs in sequence, which had 100, 300, 400 points left, things will happen like below:
- the first 250 will finish the first tech and overflow 250-100=150 [100/100, 150/300, 0/400]
- the 150 will be overwritten by the second 250 [100/100, 250/300, 0/400]
- the third 250 will finish the second tech and overflow 300-250=200 [100/100, 300/300, 200/400]
- finally, the forth 250 will overwritten the 200 [100/100, 300/300, 250/400]
See? They even cover each other. At the end, Galileo Galilei gives you only 1000-150-200=650 science points, but helps you finish 2 techs.
Chinese players discovered this bug more than a year ago and avoided it in various video and game reports as a matter of caution. I still do not think it's what the designer wants, and really hope it can be fixed in R&F.
@civtrader6 Maybe you're interested in this? In your video, Janaki Ammal only finished 2 techs, but in Rogue-Star's video, Janaki Ammal finished 4, which may be based on this calculation.