A certain man began to build a wall facing his neighbour's windows. The latter said to him, 'You are shutting out my light.' Said the first, 'Let me close up your windows here and I will make you others above the level of my wall.' He replied, 'You will damage my wall by so doing.' 'Let me then,' he said, 'take down your wall as far as the place of the windows and then rebuild it, fixing windows in the part above my wall.' He replied, 'A wall of which the lower part is old and the upper part new will not be firm.' 'Then,' he said, 'let me take it all down and build it up from the ground and put windows in it.' He replied, 'A single new wall in a house, the rest of which is old, would not be firm.' He then said, 'Let me take down the whole house and put windows in the new building.' He replied, 'Meanwhile I have no place wherein to live.' 'I will rent a place for you,' said the other. 'I don't want to bother,' said the first. Said R. Hama [on hearing of the case]: He had a perfect right to stop him. Is not this case the same as the other? Why, then, this repetition? — To tell us [that the owner of the house may exercise his veto] even though he only uses it for storing straw and wood.
In the entire length of this exchange, in which they consider shutting up windows, entirely, no one raises the possibility of sheidim. And Chazal surely encountered sheidim on a day to day basis. How did they not know of the issue raised by R' Yehuda Hachassid in his tzavaah, and in sefer chassidim? Even if the windows are rebuilt higher up, the sheidim will need to change their regular path and get annoyed! If standing by standing grain is considered a nezek, surely this is. And this should be mentioned, as it is quite pertinent to the discussion.
As we see in sefer chassidim, siman 1046, pictured to the right.
There are answers, such as the owner can protest successfully anyway. But I would guess that the true answer is that this is nonsense within nonsense. There was the widespread nonsense of the belief in sheidim, where Chazal likely believed in their existence, as did non-religious scientists and philosophers, such that they were part of normal, sane reality. This despite their non-existence, a feature they share with leprechauns and Care Bears. But is was entirely rational to believe in them in the time of Chazal, as well as later.
But this extra nonsense, that shutting up windows annoys sheidim to no end, appears to be R' Yehuda HaChassid's chiddush, which he derives from the malach who confronted Bilaam not wishing to divert. And if so, this would be a new nonsense which Chazal did not maintain. And so we would not expect to find gemaras which take this later innovation into consideration.