Paint bucket fill does not work on corners on the canvas

Hi,

If I draw a circle I can fill it with the paint bucket tool. But if I choose a semi circle on the corner of canvas I cannot fill it with the paint bucket tool (see the attached image). In fact for the first time the paint bucket tool works, but if I undo the brush stroke and draw again, this time the paint bucket tool does not work. What is wrong here?