Observer behavior in Minecraft version 1.11
Solution 1:
I did some testing and it seems like observers have a 1-tick cooldown time.
The observer detects when the piston extends and breaks the melon block, one tick later the piston retracts, which is not detected by the observer, because it is still within it's cooldown time.
Another tick later there is an air block in that spot, which doesn't have a block update.
I rebuilt your farm like this in 1.11.2 and it should be accurate:
Note: This is from personal testing and not from any official source, it appears to be correct, but it may be wrong.