Hello and welcome to JA.
Does there seem to be anything wrong with the bird ? Injured in any way you can see ?
Hello there are many reasons why a bird will have this kind of behavior, it could see the reflection of the sky in the window, or another bird, or other things, it may be attracted to, but there are way's to prevent this.
You could close the curtains so the bird no longer sees these reflections or close the shade, if that doesn't work put decals in the window of other bids, falcons etc.
I' sending these two web sites that will explain more and tell you how to prevent this now and in the future.
'PLEASE' Click the green accept button so I get paid for my work !!
And "POSITVE FEEDBACK" is greatly appreciated !!