I think there is a problem with the WON state recognition.
If you win and the Server takes a screenshot to detect the state, it happend sometimes that the screenshot is taken in the exact moment where the flying stars are on the screen so the detection of the WON state fails. I'm not 100% sure as I don't know if the Server code is using the gamewon.png resource file to check the WON state.
A workaround would be detecting a black rectangle in the bottom (that is not reached by flying stars) so we know we finish the level, and then check for gamelost.png to decide if we LOST. If we don't LOST we know we WON.