Is it a scientific error of the Buddha?
Sāriputta, there are these four kinds of reproduction. What four? Reproduction for creatures born from an egg, from a womb, from moisture, or spontaneously.
And what is reproduction from an egg? There are beings who are born by breaking out of an eggshell. This is called reproduction from an egg. And what is reproduction from a womb? There are beings who are born by breaking out of the amniotic sac. This is called reproduction from a womb. And what is reproduction from moisture? There are beings who are born in a rotten fish, in a rotten corpse, in rotten dough, in a cesspool or a sump. This is called reproduction from moisture. And what is spontaneous reproduction? Gods, hell-beings, certain humans, and certain beings in the lower realms. This is called spontaneous reproduction. These are the four kinds of reproduction
This idea was common in ancient times and was understandable because they had no way of understanding how maggots "appeared" on decomposing bodies, but we now know that it is false.
If it is a scientific error of the Buddha, then how can we understand his omniscience? Couldn't he see with his supernatural eye that maggots weren't really born from the decomposition of bodies? His knowledge is supposed to encompass the whole cycle of rebirths, I find it hard to see how he could be wrong about the birth of a whole part of these animal beings.