"What is flying in the sky?"
[rephrasing my old answer to hopefully make this clearer]
In this case "the sky" is not a space in which the action takes place. Instead, it is the location where something is, like a backdrop.
Although "flying" describes an action, note that the verb is not the simple infinitive 飛びます（とびます）"to fly" but とんでいます（飛んで居ます）"to be flying". It doesn't really refer to the action [of flying] but to the state of being [in flight]. Hence the use of a more static location particle.
As far as I know, で (de) is used only with action verbs. I have to admit that flying does seem like it would be an action, but flying is apparently not considered an action verb. Instead, flying is classified as a motion or movement verb in Japanese.
"Verbs like 行いく, 来くる, and 帰かえる, which deal with movement from one point to another, look like action verbs on the surface, but in their ～ている forms, they work more like change-in-state verbs"
So, then the question is, "What's a change-in-state verb?" "State verbs talk about how things are. They describe a state or condition."
"For verbs that describe actions (食たべる, 走はしる, etc) and events (降ふる, 吹ふく, etc), ～ている shows the continuation of an action."
"For verbs that describe changes in state (死しぬ, 割われる, 溶とける, etc), ～ている shows the continuation of a state."
It's starting to make sense to me possibly but only after looking at many other resources describing various uses of the te form.
This is long (60 pages) but potentially very interesting. https://faculty.washington.edu/ogihara/papers/Ogihara_teiru.pdf
If I understood what you said, that means that for the sentence "A bird flies in the sky", if you use the ます form: 飛びます (flies) or simple form: 飛ぶ then the common usage in japanese is to use を instead of で because most of the time the bird does not stand in the sky but is moving throught the sky and thus "鳥は空を飛びます". But, if you use the ~て-います (or ~て-いる) form: "飛んでいます" (is flying) then the particule should be に in all cases and thus "鳥は空に飛んでいます" because it means existing in the sky. Is that correct? Could you give references to that, because as far as i searched in books and internet i did not get this simple explanation (maybe I did not understand or missed it), or may a native japanese confirm it.
Hum... and what about "A helicopter flies in the sky" supposing the context that it is not moving???
In the sentence 鳥は空を飛びます（とりはそらをとびます）or "birds fly in the sky", the sky gets treated as the direct object of the verb.
You can compare it to the English "to walk the streets" or "to sail the seas". In the practical sense this refers to the place where you're walking/sailing, but grammatically the location actually 'undergoes' your action: the streets are being walked [by you]. More obvious examples of this construction would be verbs like "to cross the street", or "to explore the area".
This also happens in Japanese (e.g. 道を歩く（みちをあるく）= "to walk the streets"), where same construction can be used for "flying the skies".
If I understand correctly: 空で飛んでいるのは何ですか？ "That which is flying in the sky, what is it?" 空に何が飛んでいますか？ "What is that flying in the sky?"
The difference is that the first one you're it's the flying (a verb) taking place in the sky while in the second it is the thing (an object) that's located in the sky
Actually this is a really good question that I never think of. I tried many different and possible verbs using 'tori/hikouki/mushi ga sora de ...'; 'さえずる,' 'えさをとる,' 'あそぶ,' 'はばたく,' 'たたかう,' 'かんがえる,’ etc. It is interesting that only 'とぶ' does not fit there. Probably 'とり/ひこうき/虫はそらをとぶ-birds/airplanes/insects fly in the sky' by definition.
This comment is a year old so I'm not sure if this will be any use but maybe it will be useful to someone else...From what we've learned so far in this course, verbs are always at the end of the sentence/description, so they can't be moved around the way the others can be. I'm sure someone else can explain this better but I was annoyed that a question had just been downvoted and not actually answered XD