To reproduce in singleplayer:
Build the attached design (first screenshot, or third screenshot for a design that doesn't depend on BUDs), flip the lever on. Note: The piston is a sticky one. The piston should extend and retract quickly.
To cause the bug, either
- alt-tab out of minecraft for some time
- save, exit to menu and reload the save
- just wait, walk/or look around as it seems to happen randomly, too
- The piston is still pulsing, but the piston arm and the pushed block is invisible (picture 2)
- Piston arm still visible