>>24865817The logic behind Flying being immune to Ground is that since Flying-types can fly, attacks like Earthquake and Dig can't hit them. However, Sand-Attack is a Ground-type move (though it was Normal in Gen 1) and it can hit Flying-types, because it's sand being throw in their faces.
The anime isn't bound by restrictive RPG mechanics. Realistically, it would make zero sense for a creature to be immune to being hit with bones just because it can fly.