Kookaburras, Magpie-larks (Pee-Wee), and some other birds, will sometimes attack their reflection in a window. This is usually a territorial behaviour, which occurs mainly in the breeding season: the bird sees its own reflection in the glass as a rival.
Their determination to drive away the intruder makes them difficult to deter. Scaring them away isn’t effective as the impulse to find the rival and chase it out of the area is powerful. The window needs to be covered, on the outside, with material (old sheets, curtains, blankets, tarpaulin, etc.). You can also try confusing the bird, when it is off-site, by moving around any outdoor furniture, placing them in different positions and angles to the house. Some people have had success by covering their window with inflated balloons. Owl faces, cat faces and plastic snakes are not normally successful.
If your attempts to trick the bird fail, it will, over time, eventually stop of its own accord.