I found this bug by spam clicking a lever out of frustration. After further investigation, it seems as though the glitch works best at around the beginning of a minecraft day, but maybe that's just luck. I set up some redstone to make it easier to investigate. If you don't get the glitch around a second after you turn on the clock, restart the clock by clicking the comparator twice. The time that passes between the two clicks seems to play a role as well; so just keep restarting the clock with different timings until you get the glitch. Remember to use /time set 0 often (but not too often) just in case that whole "works better at sunrise" thing wasn't a coincidence.
Related issues
Attachments
Comments

Are the blocks actually there, or are they removed when you relog? If the latter, sounds like MC-54026

It's the same bug.