The control unit "forgets" the hall sensor position of the window when it is at the top, so rolls down assuming it has hit a foreign object, eg your arm.
Maybe
The window switches have two positions, press it half way and the window operates until you release the switch, press it all the way for one touch up/down. To reeducate the window as to where it should stop, hold the switch in the half way position and wind the window fully closed, keep the switch held for a few seconds after the window has reached the top, if you listen carefully you will hear a relay type click. The window is now reprogrammed.